Prisma to Drizzle converter

Move a project from Prisma to Drizzle ORM: your Prisma schema becomes a Drizzle schema for the same PostgreSQL database, keeping the table, column and constraint names Prisma created.

Prisma

Drizzle

Waiting for input

What you get

How each result is checked

  1. Step 1: Your schema is validated and read by Prisma's own schema engine (Prisma 7), so it is understood exactly as Prisma would.
  2. Step 1: The SQL is parsed back with the real PostgreSQL parser and compared with what Prisma's engine says the schema means: every table and column, its PostgreSQL type (by Prisma's documented type mapping), NOT NULL, database defaults, primary keys, unique and normal indexes (names, columns, method, sort order), foreign keys (names, columns, ON DELETE/ON UPDATE), implicit many-to-many join tables and enums.
  3. Step 2: Your SQL is read by the real PostgreSQL parser, compiled to WebAssembly.
  4. Step 2: The generated TypeScript is compiled and run with drizzle-orm itself, and Drizzle describes every table (getTableConfig).
  5. Step 2: Every column type (as Drizzle spells it in SQL), NULL/NOT NULL and default, plus every primary key, unique constraint, foreign key (name, columns, ON DELETE/ON UPDATE), index (name, method, columns, condition), CHECK count and enum is compared with your SQL.

What can't convert exactly

  • @default(uuid()), cuid(), nanoid(), ulid() and @updatedAt are filled in by Prisma Client, not the database, so those columns have no database default (same as prisma migrate). They are listed in the warnings.
  • With relationMode = "prisma" no foreign keys are created, as with prisma migrate.
  • Only the PostgreSQL provider is supported.
  • Types Drizzle has no builder for (money, xml, bytea, tsvector…) become customType() with the exact database type, and are listed in the warnings.
  • drizzle-kit has known quoting issues with some custom types that take parameters (varbit(8)) and with the internal "char" type; those are flagged in the warnings.
  • Views, functions and triggers are not part of a Drizzle table schema and are listed as ignored.

Questions

Will Drizzle work with my existing database?

Yes, that is the point: the Drizzle schema describes the database prisma migrate created, with the same names, so drizzle-kit sees no differences to migrate.

How is a two-step conversion checked?

Your input is converted to PostgreSQL (as prisma migrate writes it) first, then to the target format. Each step has its own independent check, and both must pass. The checks of both steps are listed under every result.

Is my data uploaded?

No. Everything runs in your browser, in a background worker. Nothing is sent to a server.

How do I switch from Prisma to Drizzle without losing data?

Convert your schema.prisma here: the Drizzle schema describes the tables prisma migrate already created, with the same table, column and constraint names, so nothing in the database changes. Then point drizzle-kit at the same database and switch your queries over one at a time.

How do I convert Prisma to Drizzle online?

Paste your Prisma or open a file on the left (or click Example). The Drizzle appears on the right as you type, already checked. Copy it, or download it as a file. Nothing is uploaded.

Can the Drizzle output be wrong?

Every result is checked before it is shown (the checks are listed on this page). If a check fails, the page says "Review needed" and why, instead of presenting the output as correct, and anything that cannot convert exactly is named in the notes.