ER diagram
Auto-generated, interactive entity-relationship diagrams of your schema.
Open any connection → ER diagram to see the full relational map of the database.
Cocobox introspects:
- All tables in the default schema (or the one you pick).
- All columns with types, nullability, and defaults.
- Primary keys, unique constraints, indexes.
- Foreign keys — drawn as edges between the related tables.
Layout
The diagram lays out automatically with a force-directed algorithm tuned for relational graphs (related tables clump, unrelated tables spread). Drag any node to re-position; the position is saved per user.
Click an edge to highlight the FK columns on both sides. Click a table to:
- See its full column list.
- Jump to a generated
SELECT *snippet. - Open the table’s data preview.
- Show only neighbors (1-hop subgraph).
Filter
The schema filter accepts:
- A schema name (e.g.
analytics.*). - A glob (
order_*). - A list of table names separated by commas.
- “Tables related to X” — show only tables reachable in N hops from X.
Implicit relationships
When two columns share a name and type but no FK exists (e.g. users.id and orders.user_id), Cocobox can draw a dashed “inferred” edge. Toggle this in the diagram options. Inferred edges are heuristic — verify before relying on them.
Export
- PNG — for slide decks.
- SVG — for docs.
- DBML — round-trippable to dbdiagram.io.
- PlantUML — for codebases that already use it.
Performance
Schemas with under 200 tables render instantly. Larger schemas: Cocobox progressively loads the visible neighborhood; expand groups to load more. For >1,000 tables, use the schema filter to narrow first.