Converts a CREATE TABLE statement into a Prisma model.
SQL DDL to Prisma converts a SQL CREATE TABLE statement into a Prisma model definition. Paste your DDL and it derives the model name from the table, maps each column's SQL type to the matching Prisma type, and marks primary keys and nullability. It is handy when you are introspecting an existing database schema by hand or scaffolding a Prisma model from raw DDL.
No. The conversion runs entirely in your browser using client-side JavaScript, and nothing you paste is uploaded or stored anywhere.
Integer-like types (int, integer, smallint, serial, bigint) become Int; numeric, decimal, real, float, and double become Float; bool/boolean become Boolean; date, time, timestamp, timestamptz, and datetime become DateTime; json and jsonb become Json; and uuid, varchar, char, text, and citext become String. Any unrecognized type defaults to String.
A column is marked required when it is a PRIMARY KEY or declared NOT NULL; otherwise it is made optional with a trailing question mark. Primary key columns also receive the @id attribute.
Inline column-level NOT NULL and PRIMARY KEY are recognized, but standalone constraint lines such as PRIMARY KEY, FOREIGN KEY, UNIQUE, CONSTRAINT, CHECK, and KEY are skipped, so relations and indexes are not generated. You will need to add @relation, @unique, and indexes yourself.
It processes a single CREATE TABLE statement and produces one model. The optional IF NOT EXISTS clause is supported, and quoted or bracketed identifiers (", `, [ ]) are stripped from names.