2. Quick Start¶
Your first diagram in 5 minutes. You need qdbd installed.
2.1 Write (or paste) a schema¶
Save this as schema.txt. If you already have a schema in QuickDBD, copy it from QuickDBD's editor and paste it in unchanged.
Customer
-
CustomerId PK int
Name string
Email string UNIQUE
Order as o
----
OrderId PK int
CustomerId int FK >- Customer.CustomerId
OrderDate datetime
Total decimal(10,2)
A table is a name, a line of dashes, then one column per line: name type modifiers. FK >- Customer.CustomerId means many orders → one customer. Everything else is in 3.1 Schema Syntax.
2.2 Check it¶
Errors print as schema.txt:12: error: …, using QuickDBD's own messages, and exit with code 1. That makes the same command a CI gate (7. CI and Automation).
2.3 Edit it live¶
A browser tab opens with the diagram and an editor pane.
- Edit in the pane (it autosaves 1 s after you stop typing) or in your own editor. The diagram reloads on save.
- Drag tables to arrange them. Positions are saved to
schema.layout.json; commit it with the schema (3.3 Table Positions). - Stop the server with Ctrl+C.
2.4 Build a page to share¶
schema.html is one self-contained file. Open it locally, email it, attach it to a ticket, or publish it on GitHub Pages (7.4). To send a link instead, run qdbd share schema.txt (4.4 Sharing a Link).
In the page, click a table to see its details, type +Order in the filter, or press Link to copy a URL to exactly what you're looking at. The tour is in 4.1 Reading the Diagram.
2.5 Export an image¶
qdbd export schema.txt -o schema.png # whole diagram: .png, .svg or .drawio
qdbd export schema.txt --focus Order --depth 1 -o order.svg # one table and its neighbours
.drawio files open in diagrams.net as editable ER shapes. More: 4.3 Exports.
2.6 Where next¶
| You want to… | Go to |
|---|---|
| Split a big schema into several files | 3.2 Many Files, One Diagram |
| Filter to part of the schema, or find how two tables join | 4.2 Selecting Tables, 4.1 Reading the Diagram |
| Generate the schema from a dbt project | 5.1 dbt Import |
| Send someone a link to the diagram | 4.4 Sharing a Link |
| See what a branch changes | 6. Reviewing Changes |
| Run it on every pull request | 7. CI and Automation |