Turn SQL DDL into Prisma, Drizzle or Zod definitions, with relations from declared foreign keys only and every untranslatable construct listed.
Waiting for a schema
Paste CREATE TABLE statements. Nothing is uploaded and no database is contacted.
Nothing generated yet
Paste CREATE TABLE statements on the left.
SQL Schema to ORM runs entirely on your device — nothing is uploaded, and no database is contacted.
You’re on the Free plan. Compare plans
Three targets, and the reason they are the three is that each describes a table as data — a field list with types and attributes — which is exactly what a parsed schema is. Prisma has its own schema language, Drizzle builds tables from column functions, and Zod describes an object shape. Translating between a column list and any of those is mechanical.
TypeORM, Sequelize and Mongoose are not offered, and that is a deliberate limit rather than an omission. TypeORM's shape is decorators on a class whose behaviour depends on `tsconfig` settings this tool cannot see; Sequelize's is a runtime call whose options differ by dialect and version; Mongoose describes documents, so generating one from relational DDL would mean inventing a data model rather than translating one. Emitting plausible code for those would be worse than emitting none — it compiles, it looks finished, and it is wrong in ways only a migration reveals.
Relations come from declared foreign keys only. The schema reader separates a real `REFERENCES` clause from a relationship it merely suspects because a column is called `user_id`, and only the declared ones become relation fields. A guessed relation written into a schema file is a claim the database never made, and the suggestion is reported separately so you can add the constraint if the guess was right.
Everything that cannot be translated is listed with the table it came from. A partial index has no Prisma syntax; a `CHECK` beyond `IN (…)` has no Zod form without a hand-written refinement; an arbitrary SQL expression as a default has no equivalent in either. Each appears under the output rather than disappearing from it.
For a database Prisma already manages, `prisma db pull` against the real schema is the authority. This is for the case where you have DDL and want a starting point — a migration someone sent you, a schema from another system, or a table you are still designing.
Because its shape is decorators on a class, and what they do depends on compiler settings this tool cannot see. Generating entities that look right and behave differently is worse than generating nothing — the problem surfaces at migration time.
Either relations are switched off, or the relationship was inferred from a column name rather than declared. Only a real `REFERENCES` clause becomes a relation field; a guess is reported separately, because writing it into the schema would state something the database does not.
No, when you have a live database — `db pull` reads the real schema and is authoritative. Use this when you have DDL and no database: a migration file, a schema from another system, or a design you are still writing.
No, and the generated file says so. It validates the shape of an object before it reaches the database. A foreign key, a unique index and any CHECK beyond a simple `IN (…)` are still enforced only by the database.
It falls back to the nearest safe thing — `String` in Prisma, `text` in Drizzle, `z.unknown()` in Zod — and says so in the approximate-mappings list. The alternative is inventing an equivalent that compiles and is wrong.