Database diagrams that live in git, readable at 200+ tables
Write your schema in QuickDBD’s plain-text syntax or DBML, or generate it from a dbt project. qdbd checks it, lays it out, and builds one HTML page you can search, filter and share. Every pull request shows what changed.
pipx install quickdbd-cli
qdbd in 75 seconds
A text file becomes a diagram you can explore, fill from your dbt yml and keep beside your code in VS Code. Filmed on qdbd-dbt-demo.
The real page, driven by a script
This is the actual qdbd viewer running a dbt project's ERD: four review star schemas around shared dimensions, one region each, with descriptions read from the yml. The last chapter shows what a branch changed since main. Move your mouse over it to take control.
- SearchFind a table
- RelationshipsCopy the JOIN
- Selectorsdbt-style filters
- Join pathsTable to table
- dbt ymlDocs, tags, types
- Diff vs mainChanges vs main
Already documented in dbt?
A hand-written ERD plus one # @dbt: line is enough. qdbd reads the project’s yml and docs directly — no manifest.json, no dbt parse — and fills descriptions, tags and column types. When the two disagree, qdbd check and VS Code say so.
The ERD is hand-written. The description, the finance tag and every column type come from models/schema.yml and docs.md. Open the live demo
# One line names the dbt project.
# @dbt: shop
orders
-
order_id PK
customer_id FK >- customers.customer_id
status
amount
ordered_at
models:
- name: orders
description: "{{ doc('orders') }}"
config:
tags: [finance]
columns:
- name: status
description: "{{ doc('order_status') }}"
data_type: varchar(20)
- DescriptionsModel and column docs, shown before the file’s own comment.
- TagsModel and column tags colour the diagram; filter with
tag:pii. - Types
data_typefills columns the schema leaves untyped. - Drift
qdbd checkand VS Code warn where the ERD and the yml disagree.
Hand-drawn diagrams go stale. Generated ones get unreadable.
qdbd keeps the schema as text in your repo and builds the diagram from it, so it is always current and still easy to read at hundreds of tables.
Drawing tool
- Looks exactly the way you arrange it
- Lives outside the repo
- Out of date after the next migration
qdbd
- Plain text in git, reviewed in pull requests
- Rebuilt from the text on every change
- Search, selectors and regions for 200+ tables
Diagram generated from a database
- Always matches the database
- Needs a connection to the database
- Often a wall of boxes past a few dozen tables
One text file in, every format out
schema/*.txtQuickDBD syntaxschema.dbmlDBMLdbt projectyml or manifest.json- The parser follows QuickDBD’s own parser step by step: same tables, same error messages.
qdbd check --strictguarantees a file pastes back into QuickDBD. - The layout comes from ELK. Positions you drag are saved by table name, and new tables land next to the tables they relate to, so the diagram never reshuffles.
- One renderer draws the page in your browser and the PNG and SVG in the CLI, so an export always matches what you see.
From text to diagram
# Every order belongs to one customer. Order as o ---- OrderId PK int IDENTITY CustomerId int FK >- Customer.CustomerId Status string="pending" # fulfilment state Customer - CustomerId PK int Email varchar(255) UNIQUE
# in your dbt project dbt docs generate qdbd import dbt target/ -o erd/ --infer-fks # primary keys: unique + not_null tests # relationships: relationships tests # --infer-fks: customer_id → customers
qdbd check erd/ # QuickDBD's errors qdbd serve erd/ # live editor qdbd build erd/ -o erd.html # one page qdbd export erd/ -o erd.png # or .svg .drawio qdbd path erd/ --from Invoice --to Campaign
JOIN.Every relationship is a JOIN
Pick two tables. qdbd finds the shortest path through the relationships, lights it in the diagram and writes the SQL, composite keys included. The page, qdbd path and AI agents all get the same answer.
- payment
- customer
- address
- city
- country
FROM payment JOIN customer ON customer.customer_id = payment.customer_id JOIN address ON address.address_id = customer.address_id JOIN city ON city.city_id = address.city_id JOIN country ON country.country_id = city.country_id
qdbd path erd/ --from payment --to countryYour first diagram in two minutes
- 1Install
pipx install quickdbd-cli - 2Write a schema
schema.txt - 3Edit it live
qdbd serve schema.txt - 4Build and share
qdbd build schema.txt
Diagrams built with qdbd
See what a branch changes before you merge it
qdbd diff --base origin/main erd/lists added, removed and changed tables, columns and relationships.- The GitHub Action posts it as one comment per pull request, updated on every push.
qdbd build --diff-base origin/maincolours the changes in the diagram: new in green, changed in amber, removed in red.
Your AI agent reads the schema, not the raw files
qdbd mcp serves the schema to Claude Code, Cursor, VS Code's Copilot and any other MCP client. Agents ask for tables, keys and join paths, and get short, exact answers instead of guessing.
- Claude Code
- Claude Desktop
- Cursor
- VS Code Copilot
- any MCP client
claude mcp add qdbd -- qdbd mcp
- No database connection. Answers come from the schema files in your repo.
- Small answers. Every reply has a size budget, so a 200-table schema doesn’t flood the context.
- dbt too. Point it at a dbt project: keys and relationships come from your tests.
Which tables do I join to get sales by country?
country13 match(es) for 'country' in adventureworksSalesOrderHeader → CountryRegionSalesOrderHeader -> CountryRegion: 2 join(s) 1. SalesOrderHeader.TerritoryID -> SalesTerritory.TerritoryID (N:1) — optional: LEFT JOIN keeps rows without a match 2. SalesTerritory.CountryRegionCode -> CountryRegion.CountryRegionCode (N:1) FROM SalesOrderHeader JOIN SalesTerritory ON SalesTerritory.TerritoryID = SalesOrderHeader.TerritoryID JOIN CountryRegion ON CountryRegion.CountryRegionCode = SalesTerritory.CountryRegionCode
Before you install
Do I need a QuickDBD account?
No. qdbd only uses QuickDBD’s text syntax, and it isn’t affiliated with QuickDBD. Schemas copy back and forth between the two.
Does qdbd connect to my database?
No. It reads .txt or .dbml schema files or a dbt manifest.json; nothing connects to a warehouse.
Does my schema leave my machine?
Only if you turn sharing on (QDBD_ALLOW_SHARE=1) and run qdbd share, which uploads the page to a GitHub gist in your account (secret by default), publish it yourself (a tunnel, GitHub Pages), or connect an AI agent through qdbd mcp, whose answers go to your AI provider. Built pages load nothing from the network.
How big can a diagram get?
The demos go up to 200 tables. Search, selectors, regions and collapsed views keep large diagrams workable, and --select builds a page with just the part you need.
What do I need to install?
Python 3.11 or newer. No Node, Graphviz or browser: the layout engine runs inside Python.
Can I use it in CI?
Yes. The GitHub Action checks the schema, builds the page and comments on pull requests; any other CI can run the same commands. CI and Automation
Install qdbd and build your first diagram
pipx install quickdbd-cli
Python 3.11+. No Node, Graphviz or browser to install.


Schema changes:
main→this branch2 table(s) added, 0 removed, 3 changed; 2 relationship(s) added, 0 removed
CustomerLegacyRefOrderStatus· ✏️Total: money → decimal(10,2)ProductSku