db2md¶
One URL in. Schema docs out.
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¶
- Getting started — install and run your first export
- CLI — flags and examples
- Library API — use db2md from Python
- Mermaid cardinalities — how 1–1 / 1–N / N–N are inferred