ERD diagram
Entity-Relationship Diagram — a visual graph of tables with their foreign-key relationships. Useful for understanding an unfamiliar database or explaining the structure to a teammate.
Open
- In the tab header: + New tab → ERD.
- In Schema Browser: right-click a schema → Show ERD (opens the whole schema).
- On a table: right-click → Show in ERD (opens centered on this table with its 1-hop neighbors).
What's shown
Each table is a card with:
- Header: table name
- Column list with types
- Icons 🔑 for PK, 🔗 for FK, ⚡ for unique indexes
Edges between tables:
- → regular foreign key (one-to-many)
- ⇒ unique FK (one-to-one)
- — many-to-many (via junction table — ide99 detects the pattern)
The label on the edge is the FK constraint name.
Controls
| Action |
Shortcut |
| Pan (move around the canvas) |
drag the background |
| Zoom |
mouse wheel / pinch |
| Zoom to fit |
⤢ button bottom-right |
| Re-layout (auto-arrange) |
⟳ button |
| Multi-select |
Shift + click on a card or drag-rectangle |
| Move card |
drag by header |
Layout
The auto-layout uses dagre — a hierarchical algorithm. If you like it — keep it; if not — drag cards by hand. Positions are saved to a local cache (erd-layout-{db}.json); next time you open it, the layout is the same.
The Reset layout button in the header returns to automatic.
Filters
At the top: schema list (checkboxes) — show only tables from the chosen schemas. Useful for big databases with many schemas.
Search (⌘+F) finds a table by name and centers the camera on it.
Export
The Export button:
- PNG — raster image (for slides, docs)
- SVG — vector (for documentation, editable in Figma)
- DOT (Graphviz) — to generate the schema graph in CI
When it's useful
- Onboarding new developers: "open the ERD, see how users, orders, products relate".
- Code review of migrations: "after this migration, the ERD looks like this".
- Debugging: "why does
DELETE FROM users fail? Open ERD — there's an FK with RESTRICT".
Next