SQL to ERD
Parse CREATE TABLE statements and export a Mermaid erDiagram with PK/FK annotations — client-side only. · Updated
Options
sql
Mermaid ERDtext
Draft saved locally.
Options
| Option | Description |
|---|---|
| Append parsed JSON tables | Append a JSON dump of parsed tables after the Mermaid diagram for debugging. |
FAQ
What SQL dialects are supported?
Common CREATE TABLE DDL with inline REFERENCES and FOREIGN KEY constraints. Vendor-specific extensions may need simplification.
Can I render the diagram here?
This tool exports Mermaid source. Paste it into any Mermaid-compatible viewer or Markdown preview.
Are primary and foreign keys detected?
Yes. Column-level PRIMARY KEY, table-level PRIMARY KEY, REFERENCES, and FOREIGN KEY clauses are annotated.
What if I only have SELECT queries?
This exporter needs DDL. Format queries with the SQL Formatter companion instead.
Related tools
SQL Formatter
Format messy SQL into readable, consistently indented queries.
SQL Minifier
Compress messy SQL queries into single-line statements by removing comments, blank lines, and unnecessary spaces.
Markdown Table Generator
Convert CSV, TSV, or JSON data into perfectly aligned GitHub-Flavored Markdown tables.
Diff Checker
Compare two text or code snippets side-by-side to highlight added, removed, and modified lines instantly.