Paste DBML
Paste DBML (Database Markup Language) directly into TalkingSchema to import a schema without creating a file.
Steps
- Click the Import button in the top toolbar
- Select Paste Schema
- Choose DBML as the format
- Paste your DBML into the text area
- Click Import
- TalkingSchema parses the DBML and populates the ERD
What to paste
Paste any valid DBML containing Table definitions:
Table suppliers {
id integer [pk, increment]
name varchar(255) [not null]
carbon_tier carbon_tier [not null, default: 'C']
country varchar(100)
is_active boolean [not null, default: true]
created_at timestamp [not null, default: `now()`]
}
Table products {
id integer [pk, increment]
supplier_id integer [not null]
name varchar(255) [not null]
sku varchar(100) [not null, unique]
carbon_intensity_score decimal(5,2) [not null, default: 0]
unit_price decimal(10,2) [not null, default: 0]
created_at timestamp [not null, default: `now()`]
}
Enum carbon_tier {
A
B
C
D
}
Ref: products.supplier_id > suppliers.id
What gets imported
TalkingSchema extracts the following from your DBML:
- Table definitions (name, fields, types)
- Primary key and auto-increment constraints
- NOT NULL and unique constraints
- Default values and field notes
- Enum type definitions
- Index definitions
- Relationships (
Refdeclarations)
Use cases
- Import a schema from schema-as-code tools — copy the DBML and paste it directly
- Bring in a hand-written DBML schema stored in your repo
- Migrate a schema defined in DBML tooling without uploading a file
Related
- DBML Export — export your schema back to DBML after editing
- Paste SQL — import using SQL (
CREATE TABLEstatements) instead