Skip to content
whiteboard.tools

SQL to ER diagram generator

Turn a schema dump into an entity-relationship diagram. Tables show their columns and keys, and every foreign key becomes an arrow.

usersid bigint PKemail varchar(255)display_name varchar(80)created_at timestampworkspacesid bigint PKname varchar(120)owner_id bigint FKboardsid bigint PKworkspace_id bigint FKtitle varchar(200)updated_at timestampcommentsid bigint PKboard_id bigint FKauthor_id bigint FKbody textowner_idworkspace_idboard_idauthor_id
Download

Runs in your browser. Nothing you type or drop here is uploaded.

How to use it

  1. Paste your schema: the output of pg_dump --schema-only, mysqldump --no-data, or CREATE TABLE statements you wrote by hand.

  2. Check the tables and relationships. Primary keys are marked PK, foreign keys FK, and arrows point from the referencing table to the one it references.

  3. Open the diagram in the whiteboard to group tables by domain, or download it for your documentation.

What the parser understands

Column names and types, inline PRIMARY KEY and REFERENCES, table-level PRIMARY KEY and FOREIGN KEY constraints including named ones, composite keys, quoted and schema-qualified identifiers, and ALTER TABLE … ADD FOREIGN KEY statements as written by pg_dump and mysqldump. Comments are ignored.

What it leaves out

Indexes, views, triggers and check constraints are skipped because they do not change the shape of an ER diagram. If a foreign key points to a table that is not in the pasted SQL, that table is drawn with a dashed outline so the relationship is still visible.

No database connection needed

Tools that reverse-engineer a live database need credentials and network access. This one works from text, which means you can use it on a production schema without giving anything access to production.

Start from a template

These templates are written in this tool's input format. Open one to edit its source here.

Questions

Which SQL dialects work?
The parser targets the common subset of CREATE TABLE syntax shared by PostgreSQL, MySQL, MariaDB, SQLite and SQL Server. Dialect-specific options such as storage engines or partitioning clauses are ignored rather than rejected.
Does it show one-to-many versus many-to-many?
Arrows show which table references which. Cardinality markers such as crow's feet are not drawn. A many-to-many relationship appears as a join table with two outgoing arrows.
Can I edit the diagram afterwards?
Yes. Open it in the whiteboard and each table is a group you can move, recolour and annotate. Arrows stay attached to their tables.

Further reading

Related tools