DBML Studio Pro is a visual database diagram editor. Write DBML code in the left panel and see your diagram rendered in real-time on the canvas.
Edit DBML code in the left sidebar
View and interact with diagrams on the right canvas
Click Sync to manually refresh the diagram
Use the minimap in the bottom-right for navigation
DBML Syntax
Define tables, columns, relationships, enums, schemas, aliases, and more:
// Schema + aliasTable public.users as U [headercolor: #336B87] {
id integer [pk, increment]
username varchar [not null, unique]
email varchar [unique]
created_at timestamp
}
// Enumenum status {
active [note: 'Currently active']
inactive
}
// RelationshipsRef: posts.user_id > public.users.id
Ref: users.id < follows.following_user_id
Ref: students.id <> courses.id
Column Settings
Setting
Description
pk or primary key
Mark as primary key
not null
Column cannot be null
unique
Values must be unique
increment
Auto-increment column
note: 'text'
Add a tooltip note
ref: > table.col
Inline foreign key reference
default: value
Set default value
Relationships
Visual connectors use a bar for the “one” side and a crow’s foot for the “many” side.
Manage connections and table groups from the Relationships tab. You can also drag from a PK/FK row onto a target row to create a relationship instantly.
Symbol
Type
Example
>
Many-to-One
Ref: posts.user_id > users.id
<
One-to-Many
Ref: users.id < posts.user_id
<>
Many-to-Many
Ref: students.id <> courses.id
-
One-to-One
Ref: users.id - profiles.user_id
Canvas Controls
Action
How
Pan canvas
Click and drag on empty space
Zoom in/out
Ctrl/⌘ + Scroll wheel
Move table
Drag table by header or body
Move group
Drag the group label
Resize group
Drag the bottom-right corner
Highlight relationship
Hover over a connection line
Edit table settings
Click the ⚙️ icon on table header
Undo / Redo
Ctrl/⌘ + Z / Y
Relationship fields
Toggle Rels in the header
Export Options
Save DBML - Download the current DBML text
Load - Import a DBML file
Reset View - Reset zoom and pan to default view
Tips & Tricks
Use TableGroup to visually group related tables together
Add headercolor: #hex to customize table header colors
Add tag: NAME #color to add colored badges to tables
Click the color swatch in settings to open the color wheel
Toggle the Grid switch to show/hide background dots
Toggle Rels to highlight all relationship fields
Use the Auto Layout button to automatically arrange tables