Dialects¶
db2md is dialect-aware for discovery and default schemas.
Behaviour matrix¶
| Backend | Database discovery | Default schema |
|---|---|---|
| PostgreSQL | pg_database (connectable, non-template) |
public when --schema is omitted |
| MySQL / MariaDB | SHOW DATABASES |
current catalog (--schema optional) |
| SQLite | single file / :memory: |
n/a (schema ignored) |
| Other | current database only | dialect-dependent |
System databases (skipped by default)¶
Use --include-system to keep them.
- PostgreSQL:
postgres,template0,template1 - MySQL / MariaDB:
mysql,information_schema,performance_schema,sys
Template databases are also filtered in SQL with NOT datistemplate on PostgreSQL.
SQLite notes¶
- One database per file path;
-d/--databasedoes not switch files. - If you pass a different
-dname, db2md logs a warning and still documents the file in the URL. - Comments and some constraint details depend on what SQLAlchemy’s SQLite inspector exposes.
Permissions¶
The connecting user needs read access to catalog metadata (table/column/FK/index listings). No write privileges are required.