orxtra v0.13.0 /cli.src.orxtra.cli._db
On this page

Registers db init, db verify, and db migrate (plan/apply/status), wrapping the pgdesign-generated schema executor and the pgdesign migrate CLI.

#cli.src.orxtra.cli._db

#cli.src.orxtra.cli._db

CLI db command group for database provisioning and migration.

Registers db init, db verify, and db migrate (plan/apply/status) commands on the orxtra CLI. Uses the pgdesign-generated schema executor for init/verify, and wraps pgdesign migrate subcommands for migrations.

Layering note: the generated executor ships inside the orxtra namespace at orxtra.services._generated so it resolves in both the editable dev tree and an installed wheel. The shared asyncpg adapter lives in orxtra.services._schema.

#_schema_dir

python
def _schema_dir() -> str

Return the path to the schema/ directory.

#_find_pgdesign

python
def _find_pgdesign() -> str

Locate the pgdesign binary on PATH.

#_run_pgdesign

python
def _run_pgdesign(subcommand: str, db_url: str, extra_args: list[str] | None=None) -> None

Run a pgdesign migrate subcommand and exit with its code.

#_register_migrate_commands

python
def _register_migrate_commands(db_group: strictcli.Group) -> None

Register the db migrate subgroup.

#register_db_commands

python
def register_db_commands(app: strictcli.App) -> None

Register the db command group on the orxtra CLI.

Search