climate_ref.cli.db
#
Database management commands
backup(ctx)
#
Create a manual backup of the database (SQLite only).
Source code in packages/climate-ref/src/climate_ref/cli/db.py
heads(ctx)
#
Show the latest migration revision(s).
Source code in packages/climate-ref/src/climate_ref/cli/db.py
history(ctx, last=None)
#
Show the migration history.
Source code in packages/climate-ref/src/climate_ref/cli/db.py
migrate(ctx)
#
Run database migrations to bring the schema up to date.
This applies any pending Alembic migrations. A backup is created before migrating (SQLite only).
Source code in packages/climate-ref/src/climate_ref/cli/db.py
sql(ctx, query, limit=100)
#
Execute an arbitrary SQL query against the database.
SELECT queries display results as a table (default limit: 100 rows). Other statements report the number of rows affected.
Source code in packages/climate-ref/src/climate_ref/cli/db.py
status(ctx)
#
Check if the database schema is up to date.
Shows the current revision, the latest available revision, and whether any migrations are pending.
Source code in packages/climate-ref/src/climate_ref/cli/db.py
tables(ctx)
#
List all tables in the database.