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")
}
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")
}
What This Tool Does
Drizzle ↔ Prisma Schema Converter is built for deterministic developer and agent workflows.
Convert Drizzle ORM schemas to Prisma and back, with parity reports for tables, columns, relations, and indexes. Manual-review hints surface enums, custom types, and extensions that need attention.
Use How to Use for execution steps and FAQ for constraints, policies, and edge cases.
Last updated:
This tool is provided as-is for convenience. Output should be verified before use in any production or critical context.
Agent Invocation
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.
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.