Skip to content

db2md

One URL in. Schema docs out.

Database → db2md → Markdown → Mermaid ER

Database  →  db2md  →  Markdown  →  Mermaid ER

Connect with any SQLAlchemy URL. Discover databases. Introspect tables, foreign keys, indexes, and comments. Write one Markdown file per database with a Mermaid ER diagram — no hardcoded names, no config file.

pip install 'db2md[postgres]'
db2md --url 'postgresql+asyncpg://user:pass@localhost:5432/postgres'
# → ./schemas/<database>.md

Why db2md?

Async-native SQLAlchemy 2.x + async drivers (asyncpg, aiomysql, aiosqlite)
Zero hardcoding Everything comes from introspection
Docs you can commit Markdown + Mermaid — preview on GitHub, MkDocs, Notion…
Library + CLI Script it, or run db2md in CI

Next steps