What Is DBML at dbml.dbdiagram.io?
Updated
DBML at dbml.dbdiagram.io is the web-based tool for DBML (Database Markup Language), a plain-text syntax for defining database schemas. You use it to write or paste DBML definitions in the browser and turn them into a working schema model, typically as a step toward a database diagram. It is a focused language/tooling resource tied to dbdiagram.io's diagram workflow, not a general-purpose website.
What the tool is for
DBML is a human-readable way to describe tables, columns, relationships, indexes, and notes. Instead of clicking through a visual editor, you type a compact definition. The dbml.dbdiagram.io tool is the browser-based entry point for that syntax: you provide the DBML text, and the tool interprets it as a schema definition.
This makes it useful when you want to:
- Draft a schema quickly in text form before building a diagram
- Keep a schema definition under version control alongside application code
- Share a precise, readable schema with teammates instead of a screenshot
- Move from a written definition to a visual database diagram in dbdiagram.io
How it fits with dbdiagram.io
The hostname places the tool within the dbdiagram.io family. The practical relationship is a pipeline: DBML is the input language, and database diagrams are a common output. You define the schema in DBML, and the diagram workflow renders that structure visually.
| Layer | What it is | Role |
|---|---|---|
| DBML | A text-based database markup language | How you describe tables and relationships |
| dbml.dbdiagram.io | Browser-based tool for DBML | Where you write or paste and validate the definition |
| dbdiagram.io | Diagram-focused product | Where schema definitions become visual diagrams |
What DBML definitions typically contain
A DBML file is organized around table blocks. Within each block you list columns with their types and constraints, and you express relationships between tables. For example, a minimal definition looks like this:
Table users {
id integer [primary key]
email varchar [unique, not null]
created_at timestamp
}
Table orders {
id integer [primary key]
user_id integer
total decimal
}
Ref: orders.user_id > users.id
The Ref line declares a foreign-key-style relationship. The bracketed settings such as [primary key] and [not null] carry column constraints. This is the kind of input the tool is built to accept.
When to use it, and when not to
Use it when your priority is a precise, text-first schema that can be reviewed, diffed, and reused, and when you intend to produce a diagram from that definition.
Look elsewhere when you need a full database administration console, live query execution, or a GUI-only modeling experience. The tool's scope is schema definition and diagram-oriented modeling, not database operations.
Practical starting point
- Open dbml.dbdiagram.io in a browser.
- Write or paste a DBML definition using
Tableblocks andRefrelationships. - Check that the definition is accepted and the structure reads as intended.
- Carry the definition into the dbdiagram.io diagram workflow to visualize it.
The main thing to confirm on first use is that your table and reference syntax is accepted; once it is, the same definition can serve as both documentation and diagram source.