Render a diagram
Draw the model as Mermaid, Graphviz DOT, or a deterministic SVG or HTML diagram.
databee draws the model itself, from the model files, so a diagram never goes stale.
Text diagrams
databee visualize erd # Mermaid on stdout
databee visualize erd --format dot # Graphviz DOT
databee visualize erd --schema shop --output erd.mmd
Both show keys and cardinalities. For DOT, positions come from diagrams/layout.json if it exists.
SVG and HTML
databee visualize render
databee visualize render --format html --theme dark
databee visualize render --view focus --entity shop.order --depth 2
By default the file goes to diagrams/<view>.<format> in the project.
| Option | Values |
|---|---|
--view |
erd (default), focus, diff, overview |
--detail |
keys, columns (default), full |
--theme |
light (default), dark, print |
--format |
svg (default), html |
focus draws one entity and the tables its foreign keys reach within --depth steps (default 1). overview suits a schema with many tables, where the full ERD would warn with DB-RND-002. diff marks what changed since a snapshot, --from <snapshot> picking the starting point (the newest by default). The HTML format adds a text description, an entity table and the findings. --open opens the file, but only in an interactive terminal.
The output is deterministic: the same model and options give the same bytes, so diagrams can be committed and reviewed like any other file.