Schema Diagram
Visualize your database structure with an interactive entity-relationship diagram.
Overview
The Schema Diagram provides a visual map of your database, showing all tables and their relationships at a glance. It helps you understand unfamiliar databases quickly and navigate between related data.
Schema diagram overview
Accessing the Schema Diagram
- Open any database connection
- Click Schema in the sidebar navigation
- The diagram loads automatically with all tables
Understanding the Diagram
Tables
Each table appears as a card showing:
- Table name - Header with the table name
- Row count - Estimated number of records (formatted: 1K, 10K, 1M)
- Columns - Expandable list of all columns
Table node in diagram
Column Indicators
Columns display icons indicating their type and role:
| Icon | Meaning |
|---|---|
| Key (amber) | Primary Key |
| Link (violet) | Foreign Key |
| Calendar | Date/timestamp column |
| Hash | Numeric column |
| Type | Text column |
Relationships
Lines connect tables that have foreign key relationships:
- Lines flow from the foreign key column to the referenced table
- Hover over a table to highlight its relationships
- Connected tables and their relationship lines become emphasized
Relationship lines
Legend
The legend in the top-left explains the visual indicators:
- PK - Primary Key (amber)
- FK - Foreign Key (violet)
- Lines - Foreign key relationships
Interacting with the Diagram
Expand and Collapse Tables
Toggle column visibility for each table:
- Click a table card to expand/collapse its columns
- Use Expand All / Collapse All buttons in the header
- Collapsed tables show just the name and row count
Hover Highlighting
Hover over any table to:
- Highlight the table
- Highlight all related tables
- Emphasize the connecting relationship lines
- Fade unrelated tables
This helps trace relationships in complex schemas.
Navigate to Table Data
Click a table name to:
- Navigate to that table's data view
- Start browsing records immediately
- Apply filters and sorting as needed
Pan and Zoom
Navigate large diagrams:
- Drag the background to pan
- Scroll to zoom in/out
- Use the zoom controls in the bottom-left
- Click Fit View to see all tables
Mini Map
The mini map in the bottom-right shows:
- Your current viewport position
- Overview of the entire diagram
- Click to jump to different areas
Diagram Layout
Automatic Arrangement
Tables are automatically arranged based on:
- Foreign key dependencies (referenced tables appear first)
- Grid-based positioning for clarity
- Logical grouping of related tables
Manual Positioning
Drag tables to reposition them:
- Click and drag any table card
- Arrangement persists during your session
- Refresh to reset to automatic layout
Refreshing the Schema
When your database schema changes:
- Click the Refresh button in the header
- Wait for schema introspection to complete
- The diagram updates with new tables/columns
Schema is cached for 1 hour and refreshes automatically.
Table Sidebar
On larger screens, a sidebar lists all tables:
- Alphabetically sorted
- Shows row count per table
- Click to highlight that table in the diagram
On mobile, access this via the menu button.
Best Practices
Understanding New Databases
When exploring an unfamiliar database:
- Start with the schema diagram for an overview
- Identify the main entities (users, orders, products)
- Trace relationships to understand data flow
- Click through to explore actual data
Tracing Relationships
To understand how tables connect:
- Hover over the main table you're interested in
- See which tables it references (outgoing)
- See which tables reference it (incoming)
- Follow the highlighted lines
Complex Schemas
For databases with many tables:
- Use zoom to see the full picture
- Use the mini map for navigation
- Collapse tables you're not focused on
- Hover to isolate specific relationships
Performance
Large Schemas
The diagram handles large schemas efficiently:
- Tables render on-demand as you pan
- Relationship lines use optimized paths
- Row counts use PostgreSQL estimates
Loading States
While the diagram loads:
- A skeleton placeholder appears
- Tables populate as schema loads
- Relationships draw after all tables
Current Limitations
- Single schema - Shows only the public schema by default
- No editing - The diagram is read-only; use data views to edit
- Session layout - Manual positioning resets on page refresh
- Dense schemas - Very large schemas (100+ tables) may require more panning
Next Steps
- Navigate relationships in the data view
- Browse table data after identifying tables of interest
- Search for records across your database