Turn Any Relational Database into a Typed Knowledge Graph
dgi connects to your database, walks the entire schema, and produces a rich knowledge graph where every table, column, index, foreign key, view, and stored procedure becomes a node — and every structural or implicit dependency becomes a typed directed edge. In one command.
dgi --config production.toml
Static SQL Body Parsing
Infers implicit DEPENDS_ON edges from SQL view definitions and stored procedure bodies without executing any SQL code.
Multi-Engine Native Connectors
Native high-speed drivers for PostgreSQL 13+, MySQL 8+, MariaDB 10.6+, and Microsoft SQL Server 2019+ with full integration test coverage.
4 Export Formats Included
Export to single-file interactive HTML, GraphML for Gephi/Cytoscape, structured JSON for environment diffing, or direct Neo4j Bolt import.
Production Relational Databases Grow Complex and Unpredictable
After a few years of production traffic, most databases nobody fully understands are the ones everyone is afraid to touch. Foreign keys tell you part of the story, but views and stored procedures create invisible dependencies inside SQL bodies.
Columns get deprecated but never dropped because nobody knows what still reads them. Database migrations get delayed because impact is unclear. Static ER diagrams go stale within a single sprint.
dgi was built for this. It reads the database directly — no manual input, no ORM metadata — making your entire data layer visible and queryable.
[connection]
driver = "postgres" # postgres | mysql | mariadb | sqlserver
host = "localhost"
port = 5432
username = "myuser"
password = "mypassword"
database = "mydb"
[export]
format = "html"
output = "./graph.html"
# Run introspection command:
# $ dgi --config production.toml
What Gets Captured
Every object in the schema becomes a node. Every structural or logical relationship becomes a typed directed edge.
| Edge Type | From Node | To Node | Extraction Technique |
|---|---|---|---|
CONTAINS |
Database, Schema | Table, View, Procedure | Direct schema metadata catalog walk |
HAS_COLUMN |
Table | Column | Information schema column introspection |
HAS_INDEX |
Table | Index | Index definition & composite column parsing |
REFERENCES |
Table | Table | Foreign Key constraint declaration |
DEPENDS_ON |
View, Procedure | Table | Static AST/regex parsing of SQL body (Zero execution required) |
How Engineering Teams Use dgi
1. Migration Impact Analysis
Before dropping a table or altering a column, run Cypher queries against Neo4j to immediately surface every view, procedure, and function that reads or writes to it.
MATCH (n)-[:DEPENDS_ON]->(t:Table {name: "subscriptions"})
RETURN n
2. Schema Audit & Missing Index Detection
Find all tables across large legacy schemas that lack secondary indexes or have unindexed foreign keys in one graph query.
MATCH (t:Table)
WHERE NOT (t)-[:HAS_INDEX]->(:Index {is_primary: false})
RETURN t.name
3. Cross-Environment Structural Drift
Export staging and production to JSON and diff the node/edge graphs in CI to catch manual hotfixes, missing columns, or missing indexes before deploys.
4. Living Interactive Documentation
Generate a standalone, zero-dependency HTML file containing Cytoscape.js interactive graphs. Share visual database maps across engineering teams.
Engineered in Rust for Speed and Dependability
- ✔ Zero Garbage Collection Pauses — Runs fast in CI pipelines and ops scripts with minimal memory footprint.
- ✔ Native Drivers — Powered by
sqlx(PostgreSQL, MySQL, MariaDB) andtiberius(SQL Server). - ✔ Typed DiGraph Storage — Internal graph representation using Rust's high-performance
petgraphlibrary. - ✔ Docker Integration Testing — Tested against live PostgreSQL 13+, SQL Server 2019+, MySQL 8+, and Neo4j instances.
Supported Database Engines
| Engine | Min Version | Status |
|---|---|---|
| PostgreSQL | 13+ | Production Ready |
| MySQL | 8.0+ | Production Ready |
| MariaDB Server | 10.6+ | Production Ready |
| Microsoft SQL Server | 2019+ | Production Ready |
Explore Your Database Schema Graph Today
dgi is licensed under Business Source License 1.1. Open source for evaluation and internal non-commercial use, converting to Apache 2.0 on 2029-01-01. Contact our engineering team for enterprise commercial licenses.