Drizzle ↔ Prisma Schema Converter
Convert Drizzle ORM schemas to Prisma and back, with parity reports for tables, columns, relations, and indexes.
Drizzle ↔ Prisma Schema Converter
// Generated by AI Dev Hub — Drizzle → Prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String
createdAt DateTime @default(now()) @map("created_at")
posts Post[]
}
model Post {
id Int @id @default(autoincrement())
authorId Int @map("author_id")
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
title String
body String?
createdAt DateTime @default(now()) @map("created_at")
@@unique([authorId, title], name: "posts_author_idx")
}
2 tables, 9 columns converted
Updated . Provided as is. Check the output before you rely on it in production.
How to use Drizzle ↔ Prisma Schema Converter
- 1
Choose a direction
Pick Drizzle → Prisma to feed in pgTable definitions, or Prisma → Drizzle to feed in model blocks. The active direction controls which input pane is read.
- 2
Paste your source schema
The parser reads pgTable() exports for Drizzle and model { } blocks for Prisma. Comments are ignored and identifiers are preserved.
- 3
Review parity counters
Check the Tables, Columns, Relations, and Indexes counters under the editor. Mismatches there usually mean the source uses constructs the parser does not recognize yet.
- 4
Read the manual-review notes
Items like enums, custom types, and database-specific extensions surface in the amber review panel. Apply them by hand before running migrations.
Questions and answers
What is Drizzle Prisma Schema Converter?
Which features convert cleanly?
Which features need manual review?
Does it run my schema on a database?
Does it send my data to a server?
For AI agents: how to call this tool
Machine-readable contract, endpoints and examples. Humans can ignore this section.
Best Path For Builders
Browser workflow
Runs instantly in the browser with private local processing and copy/export-ready output.
Browser Workflow
This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.
/drizzle-prisma-schema-converter/
For automation planning, fetch the canonical contract at /api/tool/drizzle-prisma-schema-converter.json.