Skip to main content

⌨️ Introducing the dbdiagram CLI

You can now work with both dbdiagram and dbdocs from a single command line. The dbdiagram CLI syncs your local .dbml files with your diagrams and publishes documentation to dbdocs.io β€” from your terminal or CI pipeline, no app needed.

Keep your schema in version control, push it to update the diagram, and pull to bring web edits back into your repo.

What's new:

  • Sync diagrams both ways with push and pull β€” schema and table positions included
  • Publish docs to dbdocs.io with build document
  • Set up once with init β€” later commands run without repeating flags
  • Automate updates in CI with a DBDIAGRAM_TOKEN, no browser login needed

Example:

npm install -g dbdiagram
dbdiagram auth login
dbdiagram init --entry schema.dbml --diagram-id <id>

dbdiagram push # local DBML β†’ update the diagram
dbdiagram pull # diagram β†’ update local DBML

RunSQL support is coming next, so you'll design diagrams, publish docs, and test SQL queries from one CLI.

πŸ“š Learn more β†’

Please give it a try and let us know what you think.


πŸ—‚οΈ Diagram Views in DBML

We're excited to introduce DiagramView-as-code β€” a new way to define diagram views directly in your DBML code, with no UI action needed.

Your view settings now live right alongside your schema in DBML. This means your views are version-controlled alongside your schema changes, making it easy to automate documentation and share consistent view configurations across your team.

What's new:

  • Define a default view to persist your filter settings in code
  • Create named views for stakeholders: DiagramView "Sales Team", DiagramView Engineering
  • All diagram view filtering β€” work the same whether set via UI or DBML

Example:

DiagramView "Sales Team" {
Tables {
customers
orders
products
}
TableGroups { sales }
}

DiagramView Engineering {
Tables {
users
sessions
events
}
Schemas { core analytics }
}

Note: Named views (DiagramView <name>) are available on our paid plans. Free users can only filter tables within the default view (DiagramView Default).

πŸ“š Learn more β†’

Please give this feature a try and let us know what you think.


πŸ’½ Data Sample

Great news! We're introducing Data Sample β€” a feature that lets you add example data rows directly alongside your table definitions in DBML. Now your diagrams can show not just schema, but actual data, making them far more meaningful and useful for team communication.

Here's a simple DBML example:

Table plans {
id int [pk]
name varchar
price decimal

// define inside table definition with implicit column list
Records {
1, 'Free', 0
2, 'Pro', 8
3, 'Team', 15
}
}

// OR define outside table definition
Records plans(id, name, price) {
1, 'Free', 0
2, 'Pro', 8
3, 'Team', 15
}

Define sample data right in DBML, and your diagram instantly comes alive. You can import SQL INSERT INTO statements to auto-populate records, view them in the diagram with a single click, and export back to SQL for database seeding. This keeps your reference data and schema definitions in perfect sync across docs and deployment.



Why it matters:

  • Your diagrams explain themselves β€” team members see actual data shapes and values, not just column definitions.
  • Lookup tables finally have a home β€” define plans, roles, and other reference tables with their data, all in one place.
  • Catch schema problems early β€” real data reveals missing columns, type mismatches, and broken relationships before migration.
  • Convert existing data seamlessly β€” import SQL statements and auto-convert to Records for instant visualization.
  • Seed your database faster β€” export sample data to SQL and deploy immediately.

Note:Β Data Sample is available on all plans.

πŸ“š Read the full syntax docs β†’

Try it out and let us know what you think!


🧩 dbdiagram VS Code Extension

Design and preview database diagrams without leaving your editor. The dbdiagram VS Code extension renders a live ERD from your .dbml files as you type, so you can work on your schema right alongside your code.

What's new:

  • Live ERD preview rendered straight from your .dbml files
  • Full DBML syntax highlighting and editing support
  • Generate DBML from a database connection to visualize an existing schema
  • Log in to use paid features like table groups, custom colors, and diagram views

Works in VS Code, Cursor, Windsurf, and other Open VSX–based editors.

πŸ“š Learn more β†’

Please give it a try and let us know what you think.


πŸ” SAML SSO Login

We're excited to announce SAML Single Sign-On (SSO) support for dbdiagram!

You can now access your workspace through your organization's identity provider (like Okta) using SAML 2.0. This allows workspace admins to better manage team access and keep information more secure by centralizing authentication through a single trusted source.

To get started, simply choose the Sign in with SSO option when logging in.

Note: SAML SSO authentication is available in our Custom plan.

For detailed setup instructions, see our πŸ“š SAML SSO documentation.