AT Logoatdev.blog

SQL to ERD Diagram Generator

Upload a MySQL .sql file and instantly get an interactive entity-relationship diagram. The parser reads CREATE TABLE and ALTER TABLE statements to extract tables, columns, primary keys, foreign keys, unique keys and indexes — then draws them on a zoomable, draggable canvas. Everything runs in your browser, so your schema never leaves your device. Full guide →

About SQL to ERD: Visualize Your Database Schema

Paste or upload SQL DDL and turn it into a clean entity-relationship diagram. Supports MySQL CREATE TABLE / ALTER TABLE with primary keys, composite keys, foreign keys, unique keys, indexes, defaults, AUTO_INCREMENT and comments. Auto-layout with Dagre, then export to JSON, PNG or SVG.

Key Features

  • -Parse MySQL CREATE TABLE and ALTER TABLE DDL
  • -Detect primary keys, foreign keys, unique keys and indexes
  • -Interactive canvas — zoom, pan, drag tables, minimap
  • -Automatic graph layout (Dagre) with one-click re-layout
  • -Searchable sidebar to jump to any table
  • -Export the parsed model as JSON, or the diagram as PNG/SVG
  • -100% client-side — your schema never leaves the browser

Use Cases

Understand a Legacy Database

Drop in a production schema dump and see every table and relationship at a glance before making changes.

Documentation & Onboarding

Export a PNG or SVG of the ER diagram for READMEs, wikis, and onboarding docs so new engineers ramp up faster.

Schema Reviews

Visualize migrations and pull-request schema changes to catch missing foreign keys or denormalized tables.

Data Modeling

Sketch and validate relationships while designing a new schema, then export the structured JSON model.

Frequently Asked Questions

Which SQL dialects are supported?
MySQL DDL (CREATE TABLE and ALTER TABLE … ADD) is fully supported today, including backticked identifiers, schema prefixes, composite keys and foreign keys. PostgreSQL is parsed on a best-effort basis and full support is planned.
Is my SQL uploaded anywhere?
No. Parsing and rendering happen entirely in your browser. Your .sql file and schema never leave your device.
What does the tool extract?
Tables, columns with types, nullability, defaults and comments, AUTO_INCREMENT flags, primary keys (including composite), unique keys, indexes, and foreign-key relationships from both CREATE TABLE constraints and ALTER TABLE statements.
Can I export the diagram?
Yes. Export the full parsed structure as JSON, or export the rendered diagram as a PNG or SVG image.
What happens with SQL it cannot parse?
Unsupported statements are skipped and listed in a warnings panel, so a single unusual statement never breaks the rest of the diagram.

Tips & Best Practices

  • -Use Auto Layout after loading to arrange tables left-to-right by relationship
  • -Click a table in the sidebar to center the canvas on it
  • -Export to SVG for crisp, scalable diagrams in documentation
  • -Load the bundled sample to see how the output looks before uploading your own schema
SQL to ERD - Database Diagram Generator from .sql Online | atdev.blog