schema
…
Loading…

schema

Modes

  • Browse — view the schema of any version (working tree, a branch, a commit) and filter it. Nothing is checked out. Viewing in the sidebar picks the version.
  • Compare — what changed between two versions. The Comparing card in the sidebar has presets (uncommitted changes, last commit, this branch vs main, a colleague's branch) and the base / compare pickers; ↻ Fetch picks up branches others pushed.
  • Design — sketch new tables and changes on top of the schema and hand a spec (a prompt, Markdown, SQL or JSON) to an agent; schema design check NAME verifies the result.

Diagram

  • Select tool (v): drag a box around tables or shift-click them to select several, then drag one to move them together · hold Space and drag to pan
  • Hand tool (h): drag anywhere to pan · scroll to pan · ⌘/Ctrl + scroll or pinch to zoom
  • Click a table for details (a column typed with an enum opens the enum) · double-click to show only it and its neighbours
  • Right-click a table for filtering, columns and (when designing) editing · hover to highlight its relations

Showing part of the schema

  • Type a table or pattern (card*) in the bar above the diagram; each chip shows its neighbours up to the depth on it (− / +)
  • In Compare and Design, Changes limits the view to what changed (− / + adds neighbours); All tables shows everything with the changes highlighted. Chips you add narrow the changes to the ones they match, and a chip's hops (− / + on it) add the neighbours of those changed tables.
  • Click N of M tables to see what is hidden and why

Keyboard

  • / search · f fit · +/- zoom · 0 100% · 1–5 layouts · k column modes · e edge styles
  • c changes / all tables · [ ] fewer / more neighbours · ⇧B ⇧C ⇧D switch mode · ⇧R report a bug
  • Esc close the panel / show everything / clear the filter · designing: n new table, ⌘Z undo, ⌘S apply the table you are editing

Legend

  • PK primary key · FK foreign key · UQ unique · ? nullable
  • added · removed · changed (types show old → new)
  • Crow's foot = "many" side, bars = "exactly one", circle = optional
  • Dotted edges: inferred relations and enum use · dashed edges: view dependencies · lines hop where they cross
  • ↗N relations to hidden tables · +NP hidden partitions · … N more columns click to expand

Display

Display ▾ above the diagram holds layout, columns, edges and objects; rarely needed settings sit under Advanced. Everything is remembered per file. View ▾ in the top bar switches between views saved in .schema.json and saves the current one; open a view from the CLI with schema --view NAME.

Export

Export ▾ downloads the diagram (SVG, PNG, standalone HTML) or copies the diff as Markdown, the CLI command that reproduces the view, or its config.

From the command line

schema browses · schema --at origin/feature browses a branch · schema main...feature or schema HEAD~1 compares · schema --design NAME designs.