Relationship Graph
functionalAn interactive ER diagram of the database's tables and foreign keys.
An interactive ER diagram for the database: one card per table, one arrow per foreign key. The arrow always points at the referenced table, so a chain of arrows reads as a chain of dependencies. Open it from a database's right-click Tools menu.
It reads the catalog directly, no modelling step, nothing to keep in sync. What is on screen is what the database says its foreign keys are right now, and Refresh re-reads them.
Choosing what is on the canvas
- Tables - a Tables panel with All / None / FK-connected buttons and a per-table checkbox list. The default view starts from the most-connected tables so a 600-table schema opens as a diagram rather than a hairball; picking tables yourself lifts that cap and can include tables with no relationships at all.
- Filter - type in the filter box to dim everything whose
schema.tabledoes not match. Non-matching tables stay in place, greyed, so you keep the shape of the diagram while you find something in it. - Focus - opened from a table, the diagram shows that table and its immediate neighbours. Show all brings the rest back.
What each card shows
Four switches control the level of detail, independently:
| Switch | Shows |
|---|---|
| Columns | Every column of the table, in ordinal order. Columns that take part in a foreign key are emphasised. Cards are sized to fit the whole list - nothing is truncated. |
| Types | Each column's data type, right-aligned against the card edge so it never collides with a long column name. |
| Nulls | NULL or NOT NULL per column. A column whose nullability the engine did not report says nothing rather than guessing. |
| FKs | The relationship arrows themselves. Off leaves just the table cards. |
Types and Nulls describe a column row, so they only apply while Columns is on. With columns shown, an arrow anchors at the exact column on each side rather than at the edge of the box.
Arranging it
- Layout - Grid is a deterministic row-major arrangement; Layered puts referenced tables to one side of the tables that reference them, which reads better for a hierarchy.
- Width - the − and + buttons resize every table card, and the layout spreads to match so widening cards does not overlap them. Useful when column names or types are long.
- Drag a card to place it by hand; dragged cards keep their position through a layout change. Reset layout puts everything back.
- Zoom and pan - scroll to pan, ⌘-scroll (Ctrl-scroll on Windows and Linux) or pinch to zoom between 25% and 300%, Fit to frame the whole diagram, and the percentage button to return to 100%.
- Pop out the diagram into its own resizable window, carrying its current selection and layout, when you want it beside the editor rather than over it.
- Click a table to reveal it in the schema tree.
Exports
Everything under Export exports what you are looking at, the current table selection, the current layout including any cards you dragged, and the current column/type/nullability switches. Each format can be copied to the clipboard or saved to a file.
| Format | What you get | Good for |
|---|---|---|
| SVG | The diagram exactly as drawn - boxes, arrows, positions, and the current theme's colours - as a vector image. | Dropping into a document, a wiki, or a slide at any size. |
| Mermaid | An erDiagram block: one entity per table with its key columns, one relationship line per constraint. | Markdown that renders itself - GitHub, GitLab, and most wikis draw Mermaid natively, and it stays diffable in review. |
| DBML | A Table block per table with its key columns, plus a Ref per relationship. | Feeding schema tools that read DBML, and keeping a text-first record of the model in version control. |
Mermaid and DBML describe the relationships, not the full schema: they carry the tables and the columns that participate in keys. For complete, runnable DDL use Script as CREATE below.
Script as CREATE
Script as CREATE in the toolbar turns the tables in view into one runnable script and opens it in a new editor tab for review. "In view" means exactly what the canvas shows: the tables you picked in the Tables panel, or the focused table and its neighbours while a focus is active. Nothing is executed.
The tab is bound to the diagram's own connection and database, even if you switch the workbench to another connection while the script is being built. The button reads Scripting… while a run is in progress, so one click opens one tab.
- Dependency order - referenced tables are created before the tables that reference them, so the script runs top to bottom on an empty database, provided any table outside the chosen set that a chosen table references already exists there. Each such reference is listed as a warning.
- Cycles - when foreign keys form a loop (A references B and B references A), the tables are still all created, and each foreign key that would point at a table not created yet is moved to an
ALTER TABLE … ADD CONSTRAINTafter everyCREATE TABLE. Self-references stay inline. - Warnings - anything worth checking is listed as
-- WARNINGlines at the top: a dependency cycle, a referential action the engine does not accept, a default that needs a sequence to exist first, a reference to a table outside the chosen set, a catalog read that failed (CHECK constraints or descriptions, for example), or a table whose metadata could not be read at all. An unreadable table is written as a-- SKIPPEDline rather than aborting the script, and foreign keys that point at it are written commented out at the end so the rest of the script still runs.
What each engine's script carries
| Engine | Included | Not included |
|---|---|---|
| SQL Server / Azure SQL | Built from the catalog: column types, nullability, named defaults, identity with its real seed and increment, computed columns (PERSISTED kept), column collations that differ from the database default, the primary key, CHECK constraints, indexes, foreign keys with their referential actions, the table's filegroup (ON and TEXTIMAGE_ON), ROW or PAGE data compression on the table and on each index, and table and column descriptions. | Triggers and permissions. Columnstore indexes are scripted as ordinary indexes, and an index whose partitions use different compression is scripted without it. System-versioned temporal tables, partitioned tables, memory-optimized tables, and clustered columnstore tables are scripted as ordinary tables, and a warning at the top of the script names what was left out. |
| PostgreSQL (and CockroachDB) | Built from the catalog: column types spelled the way PostgreSQL itself prints them (arrays, enums, domains, lengths), identity columns (ALWAYS or BY DEFAULT), generated columns, defaults, the primary key, CHECK constraints, indexes, foreign keys, and descriptions. A serial column is written as a BY DEFAULT identity column, because its sequence is not part of the script. | Sequences, partitioning, triggers, row-level security, ownership, and storage parameters. |
| MySQL / MariaDB | The server's own SHOW CREATE TABLE text, replayed as written: exact column types, character sets and collations, generated columns, ON UPDATE, CHECK constraints, indexes, table options, and comments. The live AUTO_INCREMENT= counter is dropped so the copy starts from 1, and a foreign key that would point at a table not created yet moves to an ALTER TABLE … ADD. | Triggers and permissions. If SHOW CREATE TABLE fails for a table, that table is rebuilt from the catalog without character sets, collations, CHECK constraints, or table options, and a warning says so. |
| Oracle Database | Built from the catalog: column types with their precision and length (NUMBER(p,s), RAW(n)), character lengths with their semantics spelled out (VARCHAR2(10 CHAR) or VARCHAR2(10 BYTE)), INTEGER columns as INTEGER, identity, virtual columns, defaults, the primary key, CHECK constraints, indexes, foreign keys (Oracle accepts only ON DELETE CASCADE and SET NULL), and descriptions. | Storage clauses, tablespaces, partitioning, column collations, and triggers. |
| SQLite, libSQL, DuckDB, ClickHouse | The engine's own stored CREATE text, replayed in dependency order, followed by the table's indexes on SQLite, libSQL, and DuckDB. This keeps engine clauses such as ClickHouse's ENGINE and SQLite's WITHOUT ROWID. | Triggers and anything else the engine stores outside the table's own definition. |
This is scripting from the live database, not a visual modeller: the diagram stays read-only, and a foreign key to a table outside the chosen set is kept as written, so that table has to exist wherever you run the script. Drawing new tables and relationships on the canvas is future work.



