Schema Visualization
Visualize database schemas as Entity-Relationship Diagrams.
Quick Start
Section titled “Quick Start”# Interactive HTML diagramsql-splitter graph dump.sql -o schema.htmlOpen schema.html in a browser for an interactive diagram with:
- Dark/light theme toggle
- Pan and zoom
- Click to highlight relationships
Output Formats
Section titled “Output Formats”HTML (Interactive)
Section titled “HTML (Interactive)”sql-splitter graph dump.sql -o schema.htmlBest for exploration and presentations.
Mermaid (Markdown)
Section titled “Mermaid (Markdown)”sql-splitter graph dump.sql -o schema.mmd --format mermaidEmbed in Markdown documentation:
```mermaiderDiagram users { INT id PK VARCHAR name VARCHAR email } orders { INT id PK INT user_id FK } orders }|--|| users : user_id```Graphviz DOT
Section titled “Graphviz DOT”sql-splitter graph dump.sql -o schema.dotRender with Graphviz:
dot -Tpng schema.dot -o schema.pngdot -Tsvg schema.dot -o schema.svgdot -Tpdf schema.dot -o schema.pdfOr use --render:
sql-splitter graph dump.sql -o schema.png --renderJSON (Data)
Section titled “JSON (Data)”sql-splitter graph dump.sql --json -o schema.jsonFor programmatic processing.
Filtering Tables
Section titled “Filtering Tables”Include specific tables
Section titled “Include specific tables”sql-splitter graph dump.sql --tables "user*,order*" -o filtered.htmlExclude tables
Section titled “Exclude tables”sql-splitter graph dump.sql --exclude "log*,audit*,temp*" -o clean.htmlFocus Mode
Section titled “Focus Mode”Show dependencies
Section titled “Show dependencies”Show a table and everything it depends on:
sql-splitter graph dump.sql --table orders --transitive -o orders-deps.htmlShow dependents
Section titled “Show dependents”Show a table and everything that depends on it:
sql-splitter graph dump.sql --table users --reverse -o users-deps.htmlLimit depth
Section titled “Limit depth”sql-splitter graph dump.sql --table orders --transitive --max-depth 2Detecting Cycles
Section titled “Detecting Cycles”Find circular foreign key dependencies:
sql-splitter graph dump.sql --cycles-onlyOutput:
Circular dependencies found: orders → payments → invoices → ordersVisualize cycles:
sql-splitter graph dump.sql --cycles-only -o cycles.htmlLayout Options
Section titled “Layout Options”# Horizontal (left-to-right)sql-splitter graph dump.sql --layout lr -o horizontal.html
# Vertical (top-to-bottom)sql-splitter graph dump.sql --layout tb -o vertical.htmlDocumentation Integration
Section titled “Documentation Integration”GitHub README
Section titled “GitHub README”sql-splitter graph dump.sql -o schema.mmd --format mermaidInclude in README.md:
## Database Schema
```mermaid%%{init: {'theme': 'dark'}}%%erDiagram ...```Notion/Confluence
Section titled “Notion/Confluence”- Generate Mermaid output
- Paste into Mermaid code block
Static Site
Section titled “Static Site”- Generate HTML
- Embed in an iframe or link directly