Skip to content

dbdocs

Pythonv0.1.0MIT

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

LongShortDescription
--version-VShow version and license
--db-dDatabase name
--output-oWrite to file instead of stdout
--compact-cOmit empty columns
--tables-tComma-separated tables to document
--schema-sSchema 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
Language
Python
Versionv0.1.0
LicenseMIT
RepositoryGitHub