erd.sketch
SQL → diagram → code

The database schema, made visible

Paste a DDL script and it becomes a diagram: tables as cards, foreign keys as lines, schemas as islands. Edit it right on the canvas — the changes go back into the SQL.

Checking your session…

What it does

Reads real DDL

CREATE TABLE, foreign keys, ALTER TABLE ADD CONSTRAINT, composite and self-referencing keys. The dialect is detected from the script itself.

Edits on the canvas

Columns, tables, field order, names. Every edit rewrites the script itself, not just the picture — so you see it in the editor and in the copied DDL.

Gives back code

ORM models — Prisma, TypeORM, SQLAlchemy, GORM. Plain types — TypeScript, Java, Go, C#, Rust. One table or the whole schema.

Remembers what you did

Several diagrams, sticky notes, an action history with undo and redo — one per diagram. By default all of it stays in the browser and goes nowhere.

Works with two of you

A diagram can move online and be shared by link — to view, or to view and edit. Then it opens on your other devices, and the canvas shows the others' cursors, their dragging and their edits.

Checks the schema

Seventeen rules: a table without a primary key, a foreign key without an index, money in FLOAT, a name that collides with a reserved word. Many findings have a fix button — the edit goes into the script and undoes in one step.

Writes the migration

Compares two versions of a schema and emits the ALTERs that turn one into the other. The syntax follows the dialect: ALTER COLUMN … TYPE in PostgreSQL, MODIFY COLUMN in MySQL, MODIFY (…) in Oracle.

Reads DBML and Prisma

The schema does not have to arrive as SQL: a DBML description or a schema.prisma becomes DDL — keys, indexes, enums and defaults included.

Exports a picture

PNG, SVG and PDF. The image is drawn afresh from the canvas geometry rather than grabbed off the screen — so it is vector, sharp at any size, and unaffected by the zoom you happen to be at.

Where people start

From SQL to code

From another format

Checks and migrations

ERD by database

Three steps

  1. 1

    Paste a script

    Or open a .sql file. A demo schema is already inside if you just want a look.

  2. 2

    Arrange it

    Cards drag around, schemas line up in lanes, zones outline the islands.

  3. 3

    Take the result

    Updated DDL, an ORM model, a set of types, a migration — straight to the clipboard. Or a picture as a file: PNG, SVG, PDF.