Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>dbdiagramNew to Visual Studio Code? Get it now.
dbdiagram

dbdiagram

dbdiagram

|
1,821 installs
| (2) | Free
DBML support and diagram preview for VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

dbdiagram VS Code Extension

The official VS Code extension from dbdiagram.io. It provides real-time visualization of Entity-Relationship Diagrams (ERDs) for DBML (Database Markup Language) files.

Features

  • ERD Visualization: View Entity-Relationship Diagrams (ERDs) directly in VS Code while editing DBML files.
  • DBML Support: Full syntax highlighting and editor support for .dbml files.
  • Generate DBML From a Database Connection: Generate DBML from a database connection to visualize the database.

dbdiagram VS Code Extension

Usage

Opening the Preview

When you have a .dbml file open, you can view the ERD in two ways:

  1. Editor Button: Click the preview icon in the editor title bar (visible when a .dbml file is open).
  2. Command Palette: Open the command palette (Cmd+Shift+P on macOS or Ctrl+Shift+P on Windows/Linux) and search for "DBML: Open Preview to the Side".

Editing

Simply edit your DBML file in the editor — the diagram updates automatically as you make changes.

Login for Paid Features

For users with paid plans, to access premium features, log in with your dbdiagram.io account. There are two ways to login:

  1. Command Palette: Open the command palette (Cmd+Shift+P on macOS or Ctrl+Shift+P on Windows/Linux) and search for "Login with dbdiagram".
  2. VSCode Manage Accounts: Click on the account icon in the bottom left corner of VSCode, then select "Sign in with dbdiagram to use dbdiagram".

Once logged in, paid features will be automatically enabled.

Note: Network connectivity is required to access paid features.

DBML Syntax

This extension supports the full DBML syntax. For more information about DBML syntax and how to write database schemas, visit the DBML Documentation.

Example DBML:

Table users {
  id int [primary key]
  email varchar [unique]
  created_at timestamp
}

Table posts {
  id int [primary key]
  user_id int [ref: > users.id]
  title varchar
  content text
}

DBML Reference

This extension supports the full DBML specification. For details and advanced syntax, see the DBML Documentation.

Support & feedback

  • Report issues: Report bugs or problems on the community forum: https://community.dbdiagram.io/c/report-bugs/17.
  • Feature requests: Suggest features on the community forum: https://community.dbdiagram.io/c/feature-suggestions/16.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft