SQL to Drizzle ORM Converter
Paste your PostgreSQL CREATE TABLE statements and get a ready-to-use Drizzle ORM schema. Works 100% in your browser — your SQL never leaves this page.
Paste SQL on the left and click Convert
How it works
This tool parses your PostgreSQL CREATE TABLE statements and generates equivalent Drizzle ORM schema definitions in TypeScript. The conversion happens entirely in your browser — no data is sent to any server.
What's supported
- Common PostgreSQL types: VARCHAR, TEXT, INTEGER, SERIAL, BIGINT, BOOLEAN, TIMESTAMP, DATE, NUMERIC, JSON, JSONB, UUID
- Constraints: PRIMARY KEY, UNIQUE, NOT NULL, DEFAULT, REFERENCES (foreign keys)
- Multiple CREATE TABLE statements in one input
- Inline and table-level constraints
- ON DELETE actions: CASCADE, SET NULL, RESTRICT, NO ACTION
- DEFAULT values including
NOW()andCURRENT_TIMESTAMP
Not yet supported
- Composite primary/foreign keys (a warning is shown; add
primaryKey()manually) - CHECK constraints
- Indexes (
CREATE INDEX) - Custom enums and user-defined types
- MySQL and SQLite dialects (coming soon)
Privacy
The converter runs entirely client-side in your browser. Your SQL input is never sent to our servers, stored, or logged. You can verify this by checking the Network tab in your browser's DevTools.