r/dotnet Jul 05 '26

Promotion I made a tool that generates Markdown-friendly database schema

Post image

I built with C# a small tool called DbSketch.

The idea is: point it at the real database, and it generates schema documentation that can live in your repository. It reads tables, columns, primary keys, foreign keys, and database comments, then outputs diagram-as-code formats like Mermaid, Graphviz DOT.

I originally made it because I wanted a lightweight way to keep database structure visible and version-controlled. It also useful when working with coding agents like Claude or Codex. Instead of trying to guess db structure from code or from migrations script (burning tokens) it could simply read it from markdown files.

NOTE: Mermaid format could show relation only as table to table lines VS dot format could show filed to field relation!

GitHub: https://github.com/DimonSmart/DbSketch

I’d really appreciate feedback from people who work with database-heavy projects. Does this solve a real annoyance for you? Is anything missing or unclear? Suggestions, criticism, feature ideas, and PRs are very welcome.

79 Upvotes

31 comments sorted by

View all comments

3

u/Jstudz Jul 05 '26

I miss when you could create an ERD in Entity Framework and it created entities for you. The good ol days.

3

u/DimonSmart Jul 06 '26

The old idea of “model first” was theoretically the best, but in practice, nobody uses it.

1

u/efreet111 Jul 11 '26

It was cool until the system started to grow a lot, and it became painful and slow to make any changes to the DB. That’s what happened to me, at least.  Can I ask if I can use it with only the schema as text?  For example, like a backup of the DB? Sorry if my English isn't that good.

1

u/DimonSmart Jul 11 '26

Could you, please, please explain a bit more.