snapshot¶
Output the DDL schema of a specific database table.
Usage¶
Options¶
TABLE(required) - Name of the table to snapshot--database,-d
Output¶
For standard SQL databases (SQLite, PostgreSQL, MySQL, MariaDB):
CREATE TABLEstatement with column types, nullability, and defaultsCREATE INDEXstatements- Foreign key constraints
For ClickHouse:
- The raw
CREATE TABLEquery fromsystem.tables
Notes¶
- output is printed to stdout
- useful for debugging schema differences or documenting table structure
- internally uses
sqlalchemy.inspect()for generic databases