generate_schema_proposal
Generate Drizzle ORM schemas from analysis results
Overview
Takes the raw field analysis from your WordPress export and turns it into a clean, typed database schema using Drizzle ORM. Maps WooCommerce fields to proper column types and uses JSONB for flexible custom attributes — giving you a production-ready schema for your modern stack.
How It Works
- Takes the analysis result from analyze_ingestion_file as input.
- Maps WordPress/WooCommerce fields to appropriate PostgreSQL column types (text, numeric, boolean, timestamp).
- Groups custom attributes into a JSONB column for flexibility.
- Generates a complete Drizzle ORM schema file ready to use in your project.
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
analysis_result |
object |
required | The output from analyze_ingestion_file |
table_name |
string |
optional | Name for the database table (default: products) |
What You Get Back
- Complete Drizzle ORM schema as TypeScript code
- Column type mappings with rationale
- Index suggestions for common query patterns
Example Use Case
After analyzing your WooCommerce export, this tool generates a Drizzle schema with typed columns for price, SKU, stock status, and a JSONB column for all those custom product attributes — ready to paste into your Next.js project.
Tips
Always run analyze_ingestion_file first to get the analysis_result input.
The generated schema uses JSONB for custom attributes, making it easy to query without rigid column structures.
Review the output and adjust column types if your app has specific requirements (e.g., decimal precision for prices).
