Docs
Docs/Work with data/Schema diagram

Draw a database schema diagram from your foreign keys

See how tables relate in a diagram built from your foreign keys. Select a table to read its columns, keys and indexes, then act on it.

The Schema tab turns your tables into an entity relationship diagram, so you can see how a database fits together before you write a query against it. A new teammate can follow how the data connects without reading a wiki first.

QuackDB schema diagram showing tables connected by foreign keys
The schema diagram, drawn from the foreign keys in your database.

How relationships appear

Relationships come from the foreign keys declared in your database. A database without foreign keys shows tables with no lines between them.

Work with the diagram

ActionHow
ZoomUse the buttons or a pinch gesture. Choose Fit to see everything.
RearrangeDrag a table. Your layout is remembered for that connection, and Reset layout restores the automatic one.
FindSearch by table or column name to highlight matches. Keys only hides everything but key columns.
TraceSelect a table to highlight the tables it connects to.

Table inspector

Selecting a table opens an inspector with its columns, types, keys and indexes, plus the tables it references and the tables that reference it. From there you can:

  • Open the table data
  • Add a column
  • Duplicate the table
  • Copy its CREATE TABLE SQL
  • Drop it. Dropping a table asks you to type a confirmation first.

Refresh with ⌘ R and export the schema as SQL with ⌘ E.

Need help?

Join our Discord community for support and discussions.

Join Discord