Drizzle to Prisma Schema Converter

Convert Drizzle ORM TypeScript table definitions into clean Prisma schema models and enums.

At a glance

Drizzle to Prisma Schema Converter is a free developer utility that transforms Drizzle ORM TypeScript schemas into Prisma schema models. It maps pgTable, mysqlTable, and sqliteTable definitions, enums, defaults, and primary keys into clean Prisma models 100% client-side in browser memory.

Universal Switcher:
From:
To:

100% Client-Side Drizzle to Prisma Schema Converter

Zero Server Uploads

Convert Drizzle ORM TypeScript table definitions and enums into clean, idiomatic Prisma schema models across PostgreSQL, MySQL, and SQLite.

Local Sandbox
Presets:
0 tables 0 enums

Multi-Dialect Drizzle

Full AST parsing for PostgreSQL (pgTable, serial, uuid), MySQL (mysqlTable, int), and SQLite (sqliteTable, integer).

Enums & Primary Keys

Maps Drizzle pgEnum and mysqlEnum to Prisma enum blocks, transforms autoincrement keys to @id @default(autoincrement()), and UUIDs to @default(uuid()).

100% Client-Side Privacy

Complete AST transformation in browser memory. Your private database schema files never touch an external server or remote API.

Why Use This Drizzle to Prisma Schema Converter?

100% Client-Side Privacy: Your schema files never leave your device or reach external servers.
Multi-Dialect Support: Parses PostgreSQL (pgTable), MySQL (mysqlTable), and SQLite (sqliteTable) definitions.
Comprehensive Type Mapping: Maps serial, autoincrement, uuid, varchar, integer, boolean, timestamp, and json types.
Enum & Constraint Extraction: Automatically extracts pgEnum and mysqlEnum into Prisma enum blocks and maps @unique and @default constraints.
Clean Idiomatic PSL Output: Generates beautifully formatted, properly aligned Prisma models.

How to Use Drizzle to Prisma Schema Converter

1

Enter Drizzle Schema

Paste your Drizzle ORM TypeScript code into the editor or pick one of the preset templates.

2

Configure Output Options

Select model naming conventions (PascalCase or preserve) and toggle datasource or @@map directives.

3

Copy or Download Prisma Schema

Copy the converted Prisma schema directly to your clipboard or download it as schema.prisma.

Drizzle Table to Prisma Model example

Demonstrates converting a PostgreSQL Drizzle table with a serial primary key, unique email, and nullable name into an idiomatic Prisma schema model.

Sample Drizzle TypeScript Schema Source
export const users = pgTable('users', {
  id: serial('id').primaryKey(),
  email: varchar('email', { length: 255 }).notNull().unique(),
  name: text('name')
});
Generated Prisma Schema Processed
model User {
  id    Int     @id @default(autoincrement())
  email String  @unique
  name  String?
}

Technical Specifications & Engine Details

Technical specifications and engine details for Drizzle to Prisma Schema Converter
Specification Details
Supported Formats TEXT/PLAIN, .TS, .JS → TEXT/PLAIN, .PRISMA
Execution Mode 100% Client-Side In-Browser (client)
Browser Requirements Modern browser with JavaScript enabled.
Performance Constraints Runs client-side in browser memory. Performance and file limits are bounded by available local device RAM.
Maintained by Pragyan Pahadi

100% Client-Side Privacy Guarantee

Your schema remains strictly on your local device. Zero data is transmitted to external servers.

Frequently Asked Questions

Which Drizzle dialects does this converter support?
This tool supports PostgreSQL (pgTable), MySQL (mysqlTable), and SQLite (sqliteTable) schemas, including their respective column helpers and enum definitions.
How are Drizzle primary keys and auto-increment fields mapped?
Serial columns and autoincrement integer fields map to Int @id @default(autoincrement()), while uuid columns with defaultRandom() map to String @id @default(uuid()).
Is my Drizzle schema kept private?
Yes. All conversion logic executes 100% locally in your browser memory. No code or schema data is ever transmitted over the network.

Methodology

This tool runs entirely in your browser. The example above shows a representative input and the result it produces.

Last updated .