SQL to ORM Converter
Generate ORM models straight from a database schema by pasting the CREATE TABLE SQL. Pick Prisma, TypeORM, Sequelize or Drizzle as the target and copy the result.
Turn raw SQL DDL into ORM model code without hand-typing a single field. Paste your CREATE TABLE statements and this converter reads each column's type, nullability, primary key, auto-increment and default, then rewrites the whole schema as a Prisma model, a TypeORM entity, a Sequelize definition or a Drizzle pgTable. It understands MySQL backticks and Postgres SERIAL, and it converts several tables in one paste. Everything runs in your browser, so the schema you paste never leaves the page.
How it works
- 1
Paste your CREATE TABLE SQL
Drop in one or more CREATE TABLE statements. MySQL backticks, Postgres SERIAL and multi-table dumps all parse.
- 2
Choose the target ORM
Switch between Prisma schema, TypeORM entity, Sequelize model and Drizzle pgTable; the output regenerates the moment you edit a column.
- 3
Copy or download the models
Grab the generated code with Copy, or save it as schema.prisma, entities.ts, models.js or schema.ts.
Instant & 100% private — nothing is uploaded
Everything runs locally in your browser. Your code, text and files are processed on your own device and are never sent to a server — so there are no upload waits, no size limits from us, and nothing is ever stored or logged.
Frequently asked questions
- What does the converter do with a CREATE TABLE statement?
- Paste `CREATE TABLE users (id INT PRIMARY KEY AUTO_INCREMENT, email VARCHAR(255) NOT NULL UNIQUE, created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP)` and the Prisma target returns a model with `id Int @id @default(autoincrement())`, `email String @unique` and `created_at DateTime @default(now())`, wrapped in `@@map("users")`.
- Which ORMs and SQL dialects does it handle?
- It generates Prisma, TypeORM, Sequelize and Drizzle (pg-core) code. On the SQL side it reads MySQL and Postgres DDL, including backtick identifiers, SERIAL and BIGSERIAL, AUTO_INCREMENT, VARCHAR and DECIMAL sizes, plus table-level PRIMARY KEY and UNIQUE clauses.
- How are SQL types mapped to each ORM?
- VARCHAR becomes String in Prisma and varchar in TypeORM and Drizzle, INT becomes Int, number or integer, TIMESTAMP maps to DateTime or timestamp, BOOLEAN to Boolean, and DECIMAL(10,2) carries its precision and scale through to Sequelize and Drizzle.
- Can it convert several tables at once?
- Yes. Paste a full dump with many CREATE TABLE blocks separated by semicolons and each one becomes its own model, entity or table in the output. Foreign key and index lines are skipped so the generated models stay clean.
More tools
More from the Hivly network
Free sister tools on our other sites.