Connects to a PostgreSQL database and generates a complete Markdown document of the schema. Includes all tables with columns (name, type, nullable, default, description), primary keys, foreign keys, indexes, and enum types. Uses psql under the hood — no Python database drivers needed. Output to stdout or file. Perfect for onboarding new team members, code review, and README documentation.
DatabasePostgreSQLDocumentationCLI
Features
- Full schema to Markdown: tables, columns, types, defaults
- Primary keys, foreign keys, and indexes in output
- Enum type documentation
- Compact mode omitting empty columns
- Per-table and per-schema filtering
Flags
| Long | Short | Description |
|---|---|---|
| --version | -V | Show version and license |
| --db | -d | Database name |
| --output | -o | Write to file instead of stdout |
| --compact | -c | Omit empty columns |
| --tables | -t | Comma-separated tables to document |
| --schema | -s | Schema name (default: public) |
Usage
terminal
$ dbdocs --db mydatabase
$
$ dbdocs --db mydatabase --output SCHEMA.md --tables users,orders
Dependencies
stdlib + psql (system) — subprocess, re
Install
$ curl -LO https://labs.stech-sol.com/downloads/dbdocs/0.1.0/dbdocs_0.1.0.tar.gz
$ tar xzf dbdocs_0.1.0.tar.gz
$ chmod +x dbdocs/dbdocs.py
$ sudo ln -s $PWD/dbdocs/dbdocs.py /usr/local/bin/dbdocs
About
Downloads
Verify integrity
SHA256 checksums