Skip to main content

Module legacy_cli

Module legacy_cli 

Source
Expand description

Released V1 command-line parser and command runner.

The standalone type-bridge-migration binary and the Python wheel entry point both call this module, keeping one parser, one execution path, and the same stdout/stderr and exit-code contract. Fully self-contained CLI for type-bridge migrations.

Five verbs:

  • plan — preview the ordered pending migrations (no DB).
  • sqlmigrate — print the forward/reverse TypeQL for a migration (no DB).
  • migrate — apply or roll back migrations (connected).
  • showmigrations — list migrations with applied/pending status (connected).
  • makemigrations — diff model vs live schema, write .py+.json (shells to _generate).

Pure verbs (plan, sqlmigrate) run entirely from the sidecar files on disk via load_dir_checked. The three connected verbs open their own Database::connect + Tokio runtime; the shared TypeDbStateStore and logged executor from crates/migration are reused without re-implementation (invariant 2: one engine, two bootstraps).

Functions§

run_cli
Run the released V1 migration CLI over process-style arguments.