ER Diagram
View all tables and foreign key relationships in a schema as an interactive diagram. Right-click a table in the sidebar and select View ER Diagram, or use the menu bar View > View ER Diagram.
ER diagram showing tables and foreign key relationships
Layout
Tables are arranged automatically so the diagram fills the canvas in both directions instead of stacking into one tall column. TablePro finds groups of tables connected by foreign keys, places each group together, and packs the groups across the plane. Tables with no relationships are collected into their own grid block. Each group of connected tables gets its own header color. Single tables and tables without foreign keys stay uncolored. When the system Differentiate Without Color accessibility setting is on, the tint is dropped and grouping is shown by position alone. Each table node shows:- Header: table name with icon, tinted by its relationship group
- Columns: name and data type, with badges for primary keys and foreign keys
- Edges: lines connecting FK columns to their referenced tables
Navigation
Moving Tables
Click and drag any table node to reposition it. Positions are saved automatically and persist across sessions. Drag a table toward the edge of the viewport to auto-scroll the canvas in that direction. Click Reset Layout (the circular arrow button) to return all tables to their computed positions.Compact Mode
Toggle compact mode with the compress button in the toolbar. In compact mode, each table shows only primary key and foreign key columns.Edge Notation
Edges use crow’s foot notation. The referenced table always carries a single bar (“exactly one”). The foreign key side shows the relationship’s cardinality, inferred from the column’s primary key and unique index data:
A fork (three lines) marks the “many” side, a bar marks “one”, and a circle marks an optional (nullable) side. An edge from
orders.user_id to users.id shows a fork at orders and a bar at users.
Junction Tables
When a table’s primary key is made of two foreign keys (a junction table likeuser_roles), TablePro treats it as a many-to-many relationship. By default the junction table is hidden and a single many-to-many edge is drawn between the two related tables, with a fork at each end.
Use the junction toggle in the toolbar (shown only when the schema has junction tables) to expand them back to the underlying table and its two one-to-many edges. Junction tables carry a distinct header icon when expanded.
Export
- Export as PNG: saves the diagram as an image.
Cmd+Ccopies it to the clipboard instead. - Export as SQL: opens a new query tab with
CREATE TABLEand foreign key statements for the diagram’s tables, written in the connection’s SQL dialect. SQLite inlines foreign keys in eachCREATE TABLE; other databases add them withALTER TABLE ... ADD CONSTRAINTafter the tables are created, so the script handles circular references.
Database Support
ER diagrams work with any database whose driver reports foreign keys:
Non-relational databases (MongoDB, Redis, and similar) have no diagram.
The diagram loads columns and foreign keys for the current schema. Foreign keys that reference a table outside the loaded schema are not drawn.

