SQL DDL to Type-Safe ORM Entity Compiler (Prisma, Drizzle, Zod)
generate_orm_modelsCompile SQL DDL schemas into type-safe Prisma, Drizzle, SQLAlchemy, or Zod models to scaffold application data layers and keep ORM entities synchronized with your database.
Instructions
Compiles SQL DDL schemas into type-safe ORM entities and TypeScript validation schemas (Prisma, Drizzle, SQLAlchemy, Zod). Use when scaffolding application models, generating TypeScript data layers, or synchronizing schemas; for translating raw SQL across dialects, use transpile_sql_dialect instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'schema_ddl' ('orm_target' defaults to 'drizzle_orm_typescript'), supports '?demo=true' or L402 (15 sats), and returns HTTP 400 if invalid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| orm_target | No | Target ORM framework standard: Prisma schema, Drizzle ORM TypeScript, SQLAlchemy Python 2.0, or Zod types. | |
| schema_ddl | Yes | Database schema DDL statements defining tables, primary keys, and relationships. | |
| include_relations | No | Whether to generate explicit foreign key relation decorators and navigation properties. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| compiled_code | Yes | Generated type-safe model code matching the specified ORM or validation schema framework. | |
| orm_framework | Yes | Name of the target ORM framework output produced. | |
| models_generated | Yes | List of model entity names successfully parsed and compiled from the schema. |