Turn CREATE TABLE statements into an ER diagram.
SQL DDL to Diagram reads CREATE TABLE statements and draws an entity relationship diagram. It also shows the Mermaid erDiagram text it generated and lists the foreign key relationships it found.
DDL is the part of SQL that defines structure. CREATE TABLE statements list columns, types and constraints such as PRIMARY KEY, NOT NULL, UNIQUE and FOREIGN KEY. An entity relationship diagram shows the same information visually: each table is a box of columns, and each foreign key is a line to the table it references. This tool contains a small, tolerant parser written for the common syntax of MySQL, PostgreSQL and SQLite. It reads tables and columns, picks up primary, unique and foreign keys, turns them into a Mermaid erDiagram, and renders that with Mermaid. A relationship is drawn as one-to-many by default, as one-to-one when the foreign key column is unique or is the whole primary key, and with an optional marker on the parent side when the foreign key column allows NULL. It is a helper for reading a schema, not a full SQL parser, and its limits are listed in the tips and errors below.
No. The SQL is parsed in the page, and the generated Mermaid text is rendered in the page as well.
The parser targets common MySQL, PostgreSQL and SQLite CREATE TABLE syntax, including quoted identifiers with backticks, double quotes or square brackets. Vendor-specific features beyond that may be skipped or reported.
Every foreign key becomes a parent-to-child line. It is one-to-one when the foreign key is a single unique column or covers the whole primary key, otherwise one-to-many. The parent side is marked optional when every foreign key column allows NULL and is not part of the primary key.
No. It only reads the DDL text you paste.
No. Only table names, column names and types, PK, FK and UK markers and relationships are drawn. Length and precision are dropped from types, so VARCHAR(255) is shown as VARCHAR.
Either its statement was listed in the red error box, or a parenthesis problem in an earlier statement swallowed it. Fix the first reported statement and look again.