Draw an ER diagram
An ER diagram draws the tables of a connection with their columns and the foreign keys between them, laid out so that referenced tables stand to the left. ER diagrams with export: Works.
Open a diagram
Section titled “Open a diagram”- In the Database tool window, select a connection, a folder or a table.
- Right-click and choose Diagrams › Show Diagram, or press ⌥⇧⌘U (CtrlAltShiftU). Tools › Database › Show ER Diagram does the same.
On a connection the diagram shows all tables and views; on a table it shows that table and the tables it references or is referenced by. The diagram opens fitted to the window.
Read it
Section titled “Read it”- Each box is a table: its name, then one line per column with type and the marks PK, FK and UK. Views have a dashed border and dashed lines to the tables they use.
- Each line is a foreign key, labelled with its columns, for example
warehouse_id:id. The ends show the cardinality:1or0..1at the referenced table,Nor1at the referencing one. - Lines are routed around boxes. The layout is the same each time for the same schema.
Arrange and zoom
Section titled “Arrange and zoom”- Drag a box to move it. Layout (⌥L) puts every box back in place. Positions last while the diagram is open.
- Zoom from 25 % to 400 %: ⌘= and ⌘-, ⌘0 for 100 %, ⇧⌘0 to fit, or ⌘ with the mouse wheel.
- Tab and ⇧Tab move from box to box.
Export it
Section titled “Export it”Press ⌥E or open the Export menu and choose a format:
| Format | File |
|---|---|
| Mermaid | .mmd |
| PlantUML | .puml |
| Graphviz DOT | .dot |
| SVG | .svg |
| PNG 1×, 2×, 4× | .png, .2x.png, .4x.png |
| yEd GraphML | .graphml |
| draw.io | .drawio |
Files go to .ferris-idea/diagrams/<connection>.<extension>. The text formats are also copied to
the clipboard, ready to paste into a Markdown file that renders Mermaid. Everything is drawn on your
machine; no web service is involved.
What is not there
Section titled “What is not there”No diagram of a hand-picked set of tables, no saved positions across sessions, no switches to hide columns or keys, no routines, and no editing of the schema from the diagram.
For agents
Section titled “For agents”er_diagram returns the same diagram in any of the formats above, or as JSON with the layout. It
needs read-schema; writing a PNG file also needs the right write.
er_diagramEntity-relationship diagram of a connection's tables and views: columns with PK/FK/UK marks, foreign keys with cardinality, what views use, and foreign keys leaving the selection.
No tool matches. Try fewer words, or .