r/SQL • • 2d ago

Discussion Open-source self-hosted SQL ERD modeling tool with GitHub GitOps (SQL/DBML/Mermaid), schema auditing, native Views, and MCP integration

Hey r/SQL,

I've been working on an open-source, self-hosted fork of drawDB focused on team SQL modeling workflows (PostgreSQL, MySQL, MariaDB, SQLite, MSSQL, and Oracle), and just tagged v1.0.0.

Highlights for database modeling & engineering teams:

  • Full ERD Modeling: Tables, Indexes, Native SQL Views (with JOIN ON, aliased output columns, WHERE, and MATERIALIZED), Relationships with interactive orthogonal line editing, Subject Areas, Custom Types, Enums, Notes, and SQL Headers.
  • Deterministic Schema Auditor: scores schemas (0–100, A–F) checking missing PKs, nullable PKs, unindexed foreign keys, FK type mismatches, orphan tables, and naming consistency.
  • GitHub GitOps for Schemas: push/pull schema.sql, schema.dbml, lossless .drawdb.json, and schema.mmd (Mermaid) directly via Pull Requests, with immutable versions/vN/ archives and direct GitHub import when creating a diagram.
  • Real-time Team Editing & Versioning: collaborate live on the same canvas, create named manual versions (v1, v2, ...) linked to Git commits/PRs, and control access with workspace RBAC.
  • 44-Tool MCP Server + Optional AI Architect (BYOK / Ollama): lets CLI/IDE agents inspect schemas, run quality audits, generate views/tables/relationships, cut versions, and open PRs.

Runs locally via a single Docker command (embedded SQLite, AGPL-3.0): https://github.com/DanielSantos08/drawdb-platform

Feedback from DBAs and backend engineers is very welcome!

9 Upvotes

5 comments sorted by

2

u/JakubVasovski 1d ago

Pushing schema diffs to GitHub PRs next to a deterministic auditor goes right at the ERD drift problem, since most diagrams go stale the moment a real migration lands. You list MariaDB separately from MySQL, so I'm curious whether the parser and SQL exporter handle native MariaDB DDL yet, like UUID, VECTOR, or WITH SYSTEM VERSIONING tables. Plenty of drawDB-based tools treat MariaDB as plain MySQL and trip over real dumps, so solid MariaDB coverage would make me try this.

→ More replies (1)

1

u/Discordbothost 2d ago

Add a SQL import/export test for composite foreign keys. For example, a two-column tenant/user reference should survive as one constraint, not two independent links. Applying the exported SQL to a fresh database would catch more than checking the diagram alone.

2

u/Educational-Law3878 2d ago

Good catch! I just checked the code after reading this. The editor side keeps composite FKs together, but the backend codec (used for GitHub sync and MCP) was actually only grabbing the first column.

And yeah, applying the exported SQL to a fresh DB makes way more sense than just checking the diagram. I'll fix the composite FK handling and push that exact (tenant_id, user_id) round-trip test in the next commit. Thanks for pointing it out!

1

u/CompanyMaster4769 16h ago

you don’t need to be a database wizard for marketing analytics, but basic SQL is pretty much the line between answering your own questions and waiting three days for data engineering lol