Skip to main content

Module import

Module import 

Source
Expand description

fz import supabase inspect (issue #658, ADR 0026): connects read-only to a Supabase project and writes the migration report.

--dispositions <FILE> decides the report’s needs-work and blocker items from a TOML file (ADR 0026, Decision 5); fz import supabase dispositions init writes a skeleton of that file.

The engine is cratefield-import-supabase, which reads Postgres through sqlx and so is native-only. It is behind the import-supabase feature for the reason postgres and push-send are: a venture links this crate beside a wasm build, and that graph must never see sqlx or tokio. Without the feature the command exists and says what to install — loud absence, not a silently smaller fz.

Credentials. The database URL comes from --db-url or SUPABASE_DB_URL, the Management API token from --management-token or SUPABASE_ACCESS_TOKEN, and --classify reads TYPESAFE_API_KEY through the TypeSafe adapter’s own from_env. fz never prompts (ADR 0026, Decision 6), so a missing URL is a refusal naming the variable. The values are held cleared-on-drop, never printed, and the report names the database by host and database alone.

Structs§

Credentials
Where each credential came from — the flag or the environment — with the value itself never leaving this struct.
DispositionsInitArgs
Everything fz import supabase dispositions init was given.
InspectArgs
Everything fz import supabase inspect was given.
PlanArgs
Everything the bare fz import supabase and fz import supabase plan were given (issue #728).
Rendered
The rendered report and its one-line summary.
Secret
A string that prints as [redacted]. The engine has its own; this one exists so the argument handling compiles without the feature.

Enums§

Format
The report format.

Constants§

ACCESS_TOKEN_VAR
The environment variable the Management API token is read from.
DB_URL_VAR
The environment variable the database URL is read from.
DEFAULT_TARGET_ENV
The environment variable the target Postgres URL is read from by default: the harness’s own app-database variable, the one a venture’s native runtime reads (crates/runtime-native/README.md).

Functions§

credentials
Resolves the credentials from the flags, then config (the environment). Never prompts.
dispositions_init
Runs dispositions init: inspects, then writes the skeleton file.
inspect
Runs the command: inspects, then writes the report to --out or stdout.
plan
Runs the command: inspects the source read-only, reads the target read-only, and either writes report.json, report.md and plan.json to --dir, or re-checks an approved plan with --apply --plan.
source_db_url
Resolves the source database URL from --db-url, then DB_URL_VAR in config. Never prompts. Shared by inspect and fz import supabase users (#659), which read the same source through the same variable.