Database ER Diagram
Turn a DBML schema into a live entity-relationship diagram and dialect-specific CREATE TABLE SQL, entirely in your browser.
- Write your schema in DBML — Table blocks for tables and columns, Ref lines for relationships.
- The diagram and SQL preview update live as you type. Use Sample for a ready-made schema.
- Pick a SQL dialect and copy or download the generated CREATE TABLE statements.
- Export the diagram as SVG, PNG, or JPEG using the export control.
- Live diagram: an entity-relationship diagram renders from your schema as you type.
- Dialect-aware SQL: maps DBML types to six SQL dialects and quotes identifiers safely.
- Relationship arrows: one-to-many, one-to-one, and many-to-many links are drawn between tables.
- Offline-first: no uploads, no account, no server round trip.
It is a fast way for developers and database designers to sketch a schema, visualise relationships, and get a starting DDL for their database — without installing diagramming software. Because everything runs locally, draft schemas stay on your device.
- Only Table and Ref blocks are parsed; Enum, TableGroup, Project, and Note are ignored.
- Column settings are limited to pk, increment, not null, unique, default, and ref.
- SQL types are a best-effort mapping — review generated DDL before applying it to a database.
- Diagrams are auto-laid-out in a grid; table positions are not manually draggable.
How do I build a diagram?
Write your schema in DBML — Table blocks define tables and their columns, and Ref lines define relationships between them. The diagram and SQL update live as you type.
Is my schema uploaded anywhere?
No. Parsing, diagramming, and SQL generation all happen in your browser. Your DBML is never uploaded to nTropi servers.
Which SQL dialects can I export?
PostgreSQL, MySQL, SQL Server, Oracle, SQLite, and ClickHouse. The tool maps common DBML column types to each dialect's equivalent and escapes identifiers.
What parts of DBML are supported?
This tool supports the DBML Table and Ref subsets — columns with pk, increment, not null, unique, and default settings, plus one-to-many, one-to-one, and many-to-many relationships. Enum, TableGroup, Project, and Note blocks are ignored.
What can I export?
The diagram is rendered as SVG and can be downloaded as SVG, PNG, or JPEG. SQL can be copied or downloaded as a .sql file. Nothing is saved server-side.