DBGraph is a visual database schema builder that turns node graphs into a structured Intermediate Representation (IR), with future support for compiling that IR into SQL for multiple database targets.
The project is currently in early development. The first version focuses on the visual editor, JSON IR generation, project snapshots, and export features.
DBGraph is built around a compiler-style architecture:
Node Graph
↓
Canonical IR
↓
Target Compiler
↓
PostgreSQL / SQLite / MySQL / other outputsInstead of generating SQL directly from the canvas, DBGraph uses a database-agnostic IR as the source of truth. This makes the schema easier to validate, version, export, and eventually compile to different targets.
The initial version focuses on:
- Visual canvas for database schema design
- Table and relationship nodes
- JSON IR preview
- Project JSON export
- Revision hash UI inspired by Git commits
- Layout for a future SQL output panel
At this stage, DBGraph does not compile SQL yet. The output panel displays the generated JSON IR.
DBGraph separates the logical database schema from the visual canvas state.
Project File
├── ir
│ └── Logical database schema
└── view
└── Canvas nodes, positions, edges, and viewportThis keeps the schema model clean and prevents UI-specific data from polluting the database representation.
Example:
{
"version": "0.1.0",
"ir": {
"schema": {
"tables": [
{
"id": "tbl_users",
"name": "users",
"columns": [
{
"id": "col_users_id",
"name": "id",
"type": {
"kind": "uuid"
},
"nullable": false,
"primaryKey": true,
"unique": false
}
]
}
],
"relationships": []
}
},
"view": {
"nodes": [],
"edges": [],
"viewport": {
"x": 0,
"y": 0,
"zoom": 1
}
}
}The future compiler will be written in Rust and compiled to WebAssembly.
Planned flow:
Graph State
↓
Normalized IR
↓
Rust/Wasm Compiler
↓
SQL Output + DiagnosticsPlanned targets include:
- PostgreSQL
- SQLite
- MySQL
- Prisma schema
- Drizzle schema
- Supabase migrations
DBGraph uses a revision model inspired by Git commits.
Instead of semantic versions like v0.10.4 for user projects, each saved project snapshot can have a short hash:
8f3a2c9The current revision appears in the top header and will later open a revision history dropdown.
Example:
DBGraph / username / project-name • 8f3a2c9 Run- Vite
- React
- TypeScript
- Tailwind CSS
- TanStack Router
- Rust
- WebAssembly
wasm-bindgenserdeserde_json
- Node.js
- TypeScript
- PostgreSQL
- Authentication
- Project persistence
- Revision history
DBGraph is under active early development.
The first priority is to build a stable visual editor and a clean IR model. SQL generation will be added after the IR foundation is reliable.
License not defined yet.