SQL schema visualizer
Paste your CREATE TABLE statements and instantly see an entity-relationship diagram. Visualize tables, columns, types, and foreign key relationships — all in your browser.
Paste DDL above to generate a diagram.
What is an ER diagram?
An entity-relationship (ER) diagram is a visual representation of a database schema. Each table is shown as a box containing its columns and types, and lines between boxes represent foreign key relationships. ER diagrams make it easy to understand the structure of a database at a glance.
This tool generates ER diagrams directly from SQL DDL — the CREATE TABLE statements that define your schema. Paste your DDL and the diagram is rendered instantly, with no database connection required.
When to use a schema visualizer
- Onboarding to a new codebase or database you haven't worked with before
- Reviewing migration files to understand the new schema shape
- Adding documentation to a project wiki or design doc
- Planning schema changes — paste your proposed DDL and see the structure
- Communicating database design to non-technical teammates
From static diagrams to live analytics
A schema diagram shows you the structure, but Basedash lets you actually query it. Connect your database and ask questions about your data in plain English — Basedash understands your schema, writes the SQL, and renders charts and dashboards automatically. It works with PostgreSQL, MySQL, BigQuery, Snowflake, and 750+ other data sources.
FAQ
What SQL syntax does this support?
The visualizer parses standard CREATE TABLE statements with column definitions, PRIMARY KEY constraints, and REFERENCES / FOREIGN KEY clauses. It handles common PostgreSQL, MySQL, and SQLite DDL patterns.
Is my schema stored or sent to a server?
No. All parsing and rendering happens in your browser using JavaScript and SVG. Your DDL is never transmitted or stored.
How are foreign keys detected?
The tool looks for inline REFERENCES clauses (e.g., user_id INTEGER REFERENCES users(id)) and standalone FOREIGN KEY constraints within CREATE TABLE statements. Both are drawn as relationship lines in the diagram.
Can I export the diagram?
Yes. Click the "Download SVG" button to save the diagram as an SVG file, which can be opened in any browser, design tool, or embedded in documentation.
Does it handle ALTER TABLE or other DDL?
Currently the tool focuses on CREATE TABLE statements. ALTER TABLE, CREATE INDEX, and other DDL are ignored. For the best results, paste the complete table definitions.
Why are some relationships missing?
Relationships are only drawn when foreign keys reference a table that is also defined in the DDL. If the referenced table isn't included in the input, the foreign key column is still shown but no relationship line is drawn.
Skip the SQL — let AI build your charts
Connect your data and describe what you want to see. Basedash handles the query, visualization, and dashboard.