Made by Minh (Mark) Pham

Open source under Apache 2.0, version 0.6.12

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
Using dbt? Import keys and relationships from your tests, or draw the ERD and pull its docs from your yml. dbt guide or live example
In VS Code or Cursor? The diagram beside your editor, no terminal needed. VS Code Marketplace or Open VSX
FactInternetSalesTry it live
26 columns, 8 foreign keys
Column docs, keys and join paths in every page qdbd builds

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.

Skytrax reviews, 13 tablesPlaying
  1. SearchFind a table
  2. RelationshipsCopy the JOIN
  3. Selectorsdbt-style filters
  4. Join pathsTable to table
  5. dbt ymlDocs, tags, types
  6. 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.

Descriptions from dbt, 7 tablesLive

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

Read the dbt yml guide

  • DescriptionsModel and column docs, shown before the file’s own comment.
  • TagsModel and column tags colour the diagram; filter with tag:pii.
  • Typesdata_type fills columns the schema leaves untyped.
  • Driftqdbd check and 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 syntax
schema.dbmlDBML
dbt projectyml or manifest.json
qdbdcheck, layout, render
HTML pagesearch, filter, share
PNG, SVG, draw.iodocs, slides, wikis
PR commentwhat changed vs main
AI agentsthe schema over MCP
  1. The parser follows QuickDBD’s own parser step by step: same tables, same error messages. qdbd check --strict guarantees a file pastes back into QuickDBD.
  2. 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.
  3. 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
schema.txt, live
OrderOrderIdautointCustomerIdintStatus=pendingstringCustomerCustomerIdintEmailuniquevarchar(255)
Every line you type lands in the diagram. In the page qdbd builds, click a relationship for its cardinality and the SQL 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.

  1. payment
  2. customer
  3. address
  4. city
  5. country
The Sakila database in qdbd with the path from payment to country lit
join.sql
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 country

Try it in the Sakila demo

Your first diagram in two minutes

  1. 1Installpipx install quickdbd-cli
  2. 2Write a schemaschema.txt
  3. 3Edit it liveqdbd serve schema.txt
  4. 4Build and shareqdbd build schema.txt

Full quick start

Diagrams built with qdbd

View all 21 demos

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/main colours the changes in the diagram: new in green, changed in amber, removed in red.
A qdbd diagram with new tables in green, changed tables in amber and a removed table in red
github-actions commented

Schema changes: main → this branch

2 table(s) added, 0 removed, 3 changed; 2 relationship(s) added, 0 removed

TableChange
Customer➖ LegacyRef
Order➕ Status · ✏️ Total: money → decimal(10,2)
Product➕ Sku
The same change, highlighted in the diagram. Open the demo

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.

Set up your agent

Claude Code

Which tables do I join to get sales by country?

qdbd search_schema country13 match(es) for 'country' in adventureworks
qdbd join_path SalesOrderHeader → CountryRegion
SalesOrderHeader -> 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.