Paste your DDL, a database dump or a Prisma schema. Every table, column type, primary key and foreign key is read from the file itself, not guessed
No sign-up required • Free to try
Example
Prompt: “CREATE TABLE users (id serial PRIMARY KEY, email text UNIQUE NOT NULL, created_at timestamptz); CREATE TABLE teams (id serial PRIMARY KEY, name text); CREATE TABLE team_members (team_id int REFERENCES teams(id), user_id int REFERENCES users(id), role text, PRIMARY KEY (team_id, user_id)); CREATE TABLE orders (id serial PRIMARY KEY, user_id int REFERENCES users(id), total numeric(10,2), status text);”
When the prompt is a schema, Datadef reads it instead of asking a model to redraw it. Tables, column types, composite primary keys, inline REFERENCES and ALTER TABLE ... ADD FOREIGN KEY constraints all come from the text, so a forty-table dump comes out with forty tables and nothing renamed. It takes a second or two.
Warehouse DDL rarely declares foreign keys. When a schema has none, links are read from the key names instead (fct_sales.customer_key to dim_customer.customer_key, orders.customer_id to customers) and drawn dashed, with a note saying so, so nobody mistakes an inferred link for a constraint.
Longer than the prompt box? Paste it anyway: a long paste becomes an attachment and is read whole. You can also attach a .sql or .prisma file. Add a sentence like "turn these tables into a star schema" and the request goes to the AI designer instead, with your DDL as the source.
Designing a star schema from scratch →Design PostgreSQL schemas showing tables, relationships, indexes, and constraints
Describe your data model and AI creates a professional database schema diagram with tables, columns, relationships, and constraints
Common questions about sql to er diagram converter
PostgreSQL (including pg_dump output), MySQL and MariaDB dumps, SQL Server with bracketed names, Snowflake, BigQuery, Redshift and Oracle DDL. The CREATE TABLE and ALTER TABLE structure is read, never executed, and statements it does not need (INSERT, SET, LOCK) are ignored.
Yes. Paste schema.prisma or attach it: models become tables, @id and @@id become primary keys, and every @relation(fields, references) becomes a foreign key between the right columns. Relation fields such as posts Post[] are not drawn as columns.
No. Everything works from pasted DDL or an attached .sql file, so there is nothing to install, no credentials to hand over, and it works for schemas you only have as migration files.
Common in warehouses. Links are inferred from matching key names and drawn dashed, and a note on the canvas says how many were inferred, so you can check them before sharing.
Connect the repository and the diagram is redrawn when the schema changes, or use the Datadef MCP server so your coding agent passes the migration files to create_diagram directly.
Try it free on the scratch canvas, no account needed. Pro starts with a 7-day free trial.