Drizzle ↔ Prisma Schema Converter

Drizzle source
Converted output
// 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")
}
Tables
2
Columns
9
Relations
1
Indexes
1

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. 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. 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. 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. 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.

Frequently Asked Questions

What is Drizzle Prisma Schema Converter?
Drizzle Prisma Schema Converter translates schemas between the two ORMs. It reads pgTable() definitions or Prisma model blocks, then emits the equivalent on the other side with a parity report.
Which features convert cleanly?
Tables, scalar columns, primary keys, unique constraints, default values, simple foreign keys with onDelete, single-column and composite indexes round-trip without manual edits in most projects.
Which features need manual review?
Enums, custom database types, JSONB shapes, Postgres extensions, computed columns, and partial indexes are flagged in the amber review panel because their syntax has no direct equivalent on the other side.
Does it run my schema on a database?
No. The converter is purely textual. It does not connect to Postgres, MySQL, or any database; it simply parses your input and emits the equivalent ORM source code.
Does it send my data to a server?
No. Parsing and emission happen in your browser. The schema text never leaves the tab, and there are no telemetry or analytics calls in the conversion path.