DDL to ER Diagram
Paste your database DDL — the CREATE TABLE and ALTER TABLE statements that define your schema — and get an interactive ER diagram with every table, column and foreign key drawn automatically.
How it works
- Copy your DDL from a migration, schema dump, or your database client.
- Paste it into the editor — PostgreSQL, MySQL, SQLite, SQL Server, Oracle and Snowflake DDL all parse.
- Tables render with columns; inline
REFERENCESandFOREIGN KEYconstraints become relations. - Arrange, hide tables, then export PNG/SVG or convert to Mermaid/DBML.
Example
DDL like this:
CREATE TABLE authors ( id BIGINT PRIMARY KEY, name VARCHAR(120) NOT NULL ); CREATE TABLE books ( id BIGINT PRIMARY KEY, author_id BIGINT NOT NULL ); ALTER TABLE books ADD CONSTRAINT fk_books_authors FOREIGN KEY (author_id) REFERENCES authors(id);
…renders two tables with a relation from books.author_id → authors.id, including the ALTER TABLE foreign key. Try it with your own →
Guide
DDL — CREATE TABLE, ALTER TABLE, ADD CONSTRAINT — is the most complete description of a schema that exists, and this page turns any dialect of it into a diagram. The reason this page exists separately from the per-database pages: real-world DDL is dialect soup. A migration folder might contain Postgres DDL; a vendor handover might include a SQL Server .sql script with GO batches; an ORM might emit SQLite-flavoured DDL. Paste any of them, or a mixture — the parser handles inline REFERENCES, named CONSTRAINT fk_… FOREIGN KEY blocks, and the ALTER TABLE-after-the-fact style that pg_dump produces.
Good sources of DDL you already have:
- Your migrations folder — every framework's migrations are just DDL with extra steps.
pg_dump --schema-only,mysqldump --no-data, SSMS "Generate Scripts",sqlite3 .schema.- Terraform/Infrastrucure repos that manage databases declaratively.
Statements that don't affect the diagram — CREATE INDEX, GRANT, INSERT, CREATE VIEW — are skipped without complaint, so whole dump files paste fine.
Why use it
- Private: everything runs in your browser — nothing is uploaded or stored on a server.
- Dialect-agnostic — paste DDL from any major database.
- Interactive: drag tables, auto-arrange, hide noise, add notes, and manually link columns.
- Export a high-res PNG, vector SVG, or the schema as Mermaid / DBML / PlantUML code.
- Free & open source — no account, no sign-up.
FAQ
What counts as DDL?
Data Definition Language — the CREATE TABLE, ALTER TABLE and constraint statements that define your schema. Paste them and the diagram is drawn instantly.
Does it read ALTER TABLE foreign keys?
Yes — foreign keys added via ALTER TABLE … ADD CONSTRAINT … FOREIGN KEY (as pg_dump emits) are parsed and drawn as relations.
Is my schema uploaded anywhere?
No. Everything runs locally in your browser — your schema is never uploaded to or stored on any server.
Is it free?
Yes. It is completely free and open source, with no account or sign-up required.