Cerbero.CLI.Snapshot (cerbero v0.1.0)

Copy Markdown View Source

argv for mix cerbero.snapshot: --url | --emit-sql | --from-file, --out, --config, --migration-source, --precision, --engine (postgres | cockroachdb; steers --emit-sql only — the live path detects the engine from the connection and --from-file from the file's own sections).

Loads .cerbero.exs (or the path given via --config) the same way mix cerbero.check does, so config.schemas governs which schemas the exporter reads instead of the connection always being hardcoded to ["public"], and config.precision selects the export mode (--precision exact|order_of_magnitude overrides it). A bad config or an invalid precision is an operational error (exit 2), same category as an unreachable database.

--out defaults to config.snapshot_path, so the exported snapshot lands exactly where mix cerbero.check reads it.

Summary

Functions

run(argv, opts \\ [])

@spec run(
  [String.t()],
  keyword()
) :: 0 | 2