main
CLI entry point for the Delta Table Manager.
cli(ctx, config, target, render_output)
¶
Delta Table Manager — database schema lifecycle tool.
Source code in src/cloe_delta_table_manager/cli/main.py
compare(ctx, from_state, to_state)
¶
Show the diff between two states.
FROM_STATE and TO_STATE must each be one of: solution, database, statefile.
solution — desired schema defined in SQL files statefile — last recorded state persisted on disk database — live state read from the database (not yet supported)
Source code in src/cloe_delta_table_manager/cli/main.py
deploy(ctx, yes)
¶
Deploy all pending migrations to the database.
Source code in src/cloe_delta_table_manager/cli/main.py
generate(ctx)
¶
Debug: write solution_state.json derived from SQL solution files.
Parses the SQL solution and serialises the resulting schema to solution_state.json. No live database connection is needed.
Use after 'state refresh' to diff the two files and spot any inconsistency between the SQL solution and the live database.
Source code in src/cloe_delta_table_manager/cli/main.py
init(ctx)
¶
Initialise empty state files for a target (safe to re-run).
Source code in src/cloe_delta_table_manager/cli/main.py
plan(ctx, detailed)
¶
Show pending migrations that would be run by deploy.
Source code in src/cloe_delta_table_manager/cli/main.py
refresh(ctx)
¶
Refresh the database state by crawling the live database.
Source code in src/cloe_delta_table_manager/cli/main.py
state()
¶
Manage state files.
\b refresh Crawl the live database; initialises or refreshes database_state.json. Use after out-of-band changes. generate Derive state from SQL files and write solution_state.json (debug only). No live connection needed.
Debugging tip: run 'state refresh', then 'state generate', and diff the two JSON files to spot inconsistencies between the SQL solution and the live database.
Source code in src/cloe_delta_table_manager/cli/main.py
validate(ctx)
¶
Validate project.yaml, SQL syntax, and the migration dependency graph.