Import DBML
If your schema lives in DBML — a dbdiagram.io export, a dbdocs project, or a .dbml file in your repo — paste it into DrawSQL and get the full visual diagram: tables, relationships, enums, groups, even sticky notes.
Table users {
id int [pk, increment]
email varchar [unique, not null]
created_at timestamp
}
Table posts {
id int [pk, increment]
user_id int [not null]
title varchar
status post_status
}
Enum post_status {
draft
published
}
Ref: posts.user_id > users.id
Importing DBML
In the diagram editor, click File → Import — or open the /draw playground to try it without an account.
Paste your DBML or upload the
.dbmlfile. The format is auto-detected.Click Begin Import. Syntax errors are reported with line numbers, so a broken file tells you exactly where to look.
DBML doesn't carry a SQL dialect, so DrawSQL resolves the column types for a target DBMS. In the editor that's your diagram's DBMS; on /draw you pick it with the into MySQL / PostgreSQL / SQL Server control.
Coming from dbdiagram.io? Use Export → DBML there, then paste the result straight in.
What gets imported
Tables and columns, with types, defaults, and nullability
Ref:definitions — drawn as relationshipsEnums, including columns typed against them
Indexes, including unique and multi-column ones
TableGroupblocks — imported as table groups on the canvasTable and column notes — imported as comments
Standalone
Note name { … }blocks — imported as sticky notes
Known limits
A few DBML constructs don't map onto DrawSQL diagrams. Each one is skipped and flagged in the import log, so you always know what was left out:
Many-to-many refs (
<>) — model the join table explicitly insteadComposite foreign keys — DrawSQL relationships connect one column pair
Expression columns inside index definitions
Header colors — DrawSQL assigns its own palette on import