SQL schema to DBML
Turn CREATE TABLE statements into a DBML diagram definition.
SQL schema to DBML
Paste one or more CREATE TABLE statements and this tool returns the equivalent DBML — the plain-text format used by dbdiagram.io and similar entity-relationship diagram tools. Every table becomes a Table block, every column keeps its name and type, and primary keys, unique constraints and foreign keys are carried over automatically. It is built for the moment you have a schema dump and need a diagram fast, without pasting SQL into a hosted service.
The dialect option tells the parser what it is reading — MySQL, PostgreSQL, SQLite or SQL Server — since the same keyword can mean different things across engines (a MySQL TINYINT(1) reads as a boolean, a SQL Server IDENTITY column reads as auto-increment). Turn on type mapping to collapse dialect-specific types into DBML's canonical set (int, varchar, decimal, timestamp and so on), or leave it off to keep the original names. Comments — a MySQL COMMENT clause or a PostgreSQL COMMENT ON statement — become DBML Note entries when "Keep comments" is on. Column names like user_id can optionally infer a relationship to a users table even without an explicit foreign key, and tables sharing a naming prefix (shop_orders, shop_products) can be grouped into a TableGroup.
The tool understands inline REFERENCES clauses, table-level FOREIGN KEY constraints and separate ALTER TABLE ADD CONSTRAINT statements, so it works on a single CREATE TABLE block or a full dump with keys added afterward. Composite primary keys and unique constraints are rendered as DBML indexes blocks rather than being dropped.
Everything runs locally in your browser — no schema is ever uploaded anywhere, which matters when the SQL you are pasting describes a real production database. Copy the DBML, download it as a .txt file, or send the output straight into another tool to keep working on it.