ERD Renderer & Database Visualizer for VS Code

ERD Renderer is a high-performance database diagramming extension for Visual Studio Code. It provides instant, interactive side-by-side Entity-Relationship Diagrams (ERD) for DBML and SQL files, plus a live Database Connection Wizard to visualize live PostgreSQL, MySQL, MSSQL, SQLite, and Oracle schemas.
🚀 Getting Started
1. Previewing DBML or SQL Files
- Open any
.dbml or .sql file in VS Code.
- Press
Cmd + Shift + V (macOS) or Ctrl + Shift + V (Windows/Linux).
- Alternatively, click the Preview ERD graph icon ($(graph)) on the top-right of your editor tab.
- Edit tables, columns, or relationships in code — the preview updates live within 300ms!
2. Using the Database Explorer Side Bar
- Click the Database Explorer icon 🛢️ in the VS Code Activity Bar.
- Click the
+ icon on the toolbar to add a new PostgreSQL, MySQL, MSSQL, SQLite, or Oracle connection.
- Test connectivity and save your profile (passwords are securely encrypted in VS Code Secrets).
- Expand the connection profile to browse Schemas, Tables, and Columns.
- Right-click any connection, schema, or table to:
- Visualize Database / Schema / Table
- Filter Tables & Visualize... (interactive schema, glob, and depth selector)
- Pull DBML to Workspace File...
- Open DBML in Editor
- Copy DBML to Clipboard
⌨️ Shortcuts & Actions
| Action |
Shortcut / Location |
| Open Live Preview to the Side |
Cmd+Shift+V (macOS) / Ctrl+Shift+V (Windows/Linux) or Editor Title Bar Icon |
| Connect to Database & Visualize |
Cmd+Shift+P → ERD: Connect to Database & Visualize |
| Export Diagram as SVG |
Preview Toolbar → SVG Button |
| Export Diagram as PNG |
Preview Toolbar → PNG Button |
| Copy Image to Clipboard |
Preview Toolbar → Copy PNG Button |
✨ Features
- ⚡ Live Side-by-Side Preview: Open any
.dbml or .sql file and press Cmd+Shift+V / Ctrl+Shift+V to open an instant live ERD preview.
- 🗄️ Database Explorer Side Bar: Activity Bar panel (
$(database)) to manage saved database connections, browse Schemas, Tables, and Columns (with PK 🔑 and FK 🔗 markers), and visualize with one click.
- 🔒 Encrypted Credential Storage: Database credentials and connection strings are securely encrypted and stored using VS Code Secrets (backed by your OS Keychain).
- 🔍 Granular Table Filtering & Focus: Filter large databases (100–1000+ tables) using schema selectors, glob wildcards (
orders*, sales.*), searchable table checklists, or workspace table list files.
- 🌳 Smart Relationship Depth Expansion (
--depth <N>): Select seed table(s) and automatically include 1-hop or N-hop connected foreign key parents and children.
- 📥 Dual Action Pipeline (Visual vs DBML): Choose to directly render the visual ER diagram, pull and save a clean
.dbml file to your workspace, or open an untitled .dbml editor tab.
- 🔄 Real-Time Sync: Debounced live re-rendering as you type in your schema file — preserves your current pan and zoom position so you never lose context!
- 🎯 Table Search & Tracing: Real-time table search bar in the toolbar and click-to-trace relationship highlights with dimmed backgrounds.
- 🎨 Automatic Theme Adaptation: Automatically harmonizes with your active VS Code light or dark editor theme.
- 💾 One-Click Export: Export crystal-clear vector SVG, high-resolution 2x PNG, or copy the image directly to your OS clipboard.
🔒 Security & Privacy First
Connecting to live databases requires absolute trust. erd-renderer is engineered to be safe for production and enterprise environments:
- 🛡️ 100% Local & Offline: Zero telemetry, zero external tracking, and zero cloud dependencies. Schema introspection and diagram rendering run entirely on your local machine.
- 🔑 Encrypted OS Keyring Storage: Passwords and connection strings are securely encrypted using the official VS Code
SecretStorage API (backed by Apple Keychain, Windows Credential Manager, or Linux Secret Service). Passwords are never saved in plain text.
- 👓 Strictly Read-Only Introspection: The extension only inspects database catalog metadata (tables, columns, indexes, foreign keys). It enforces read-only session transactions and never queries, modifies, or accesses table row data.
- 🧱 Sandboxed Webview with Strict CSP: Diagram previews run inside a sandboxed Webview enforcing a strict Content Security Policy (CSP) with cryptographic nonces and complete XML entity escaping.
- 🚫 Redacted Error Logs: Connection errors and diagnostic toasts automatically sanitize and mask passwords before displaying notifications.
⚙️ Extension Settings
You can customize the extension via Settings (Cmd+, / Ctrl+,) by searching for erdRenderer:
erdRenderer.debounceDelay: Delay in milliseconds before re-rendering on document changes (default: 300).
erdRenderer.theme: Color theme for the diagram (auto, light, dark).
erdRenderer.direction: Default layout direction (TB for Top-to-Bottom, LR for Left-to-Right, BT, RL).
erdRenderer.sqlDialect: Default SQL dialect when parsing raw .sql files (postgres, mysql, sqlite, mssql, oracle).
👤 Author & Connect
Created and maintained by Shubham Shakya.
If you enjoy this extension, please consider leaving a ⭐ review on the VS Code Marketplace!
| |