Skip to main content

Import DBML File

Upload a .dbml or .txt file to import an existing schema into TalkingSchema. DBML (Database Markup Language) is a human-readable format for defining database schemas.

What is DBML?

DBML (Database Markup Language) is an open-source DSL for defining database schemas. It's more readable than SQL and is used by other schema-as-code tooling.

Steps

  1. Click the Import button in the top toolbar
  2. Select Upload file
  3. Choose DBML as the format
  4. Choose your .dbml or .txt file from your computer
  5. TalkingSchema parses the file and populates the ERD

Supported file types

  • .dbml — DBML schema files
  • .txt — Text files containing DBML syntax
  • Any file containing valid DBML syntax

Tips

  • Works with DBML files exported from tools that support schema-as-code
  • Works with hand-written DBML schemas
  • Supports tables, fields, relationships (Ref), enums, and indexes
  • Comments in the DBML file are preserved as table/field notes

Example DBML file

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 [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]
created_at timestamp [default: `now()`]
}

Enum carbon_tier {
A
B
C
D
}

Ref: products.supplier_id > suppliers.id

Troubleshooting

Schema doesn't appear after upload:

  • Ensure the file contains valid DBML syntax
  • Check for syntax errors in the DBML
  • Try pasting the DBML instead via Paste DBML

Only some tables appear:

  • The parser skips invalid DBML syntax
  • Validate your DBML at your tool for schema-as-code.
  • Paste DBML — paste DBML directly without uploading a file
  • DBML Export — export your schema back to DBML