The database layer's commands, as library functions. Ported from example/Cli.scala, which was their specification (design/cli.md ยง3); the two rules of layer 1 apply to every entry point here: return values, never print; take capabilities, not connections. The http layer's are in io.eezo.http.cli.Commands, in the same shape.
dbSchema is the Postgres schema commands introspect, defaulting to public the way Introspect.snapshot does. It is a parameter for the same reason Freeze.defaultDbDir is: with it baked in, nothing here could be exercised outside the real database of whatever process is running; the suites isolate by Postgres schema, and pass their own.
freeze takes no capability: it diffs the committed snapshot against the code and writes files, and the live database is deliberately not consulted (that is sync's job). Front ends must not install a Database to run it.
Drift since the last freeze, written as a numbered, fingerprinted migration.
Drift since the last freeze, written as a numbered, fingerprinted migration.
decide is asked about every change, not only destructive ones: policy belongs to the front end (the interactive one accepts what is safe on its own and prompts on the rest, an agent passes its own), and a mechanism that filtered in advance would leave policies shaped like --skip-destructive nowhere to live.
The same diff, executed directly when apply: dev only, migrations are the reviewed path.
The same diff, executed directly when apply: dev only, migrations are the reviewed path.
A destructive or risky change refuses an unforced apply, exactly as example/Cli.scala did; force applies everything, including what was blocked.
The diff is reported in Postgres's spelling but run in the model's: Postgres does not always spell its own spelling back the same way (an in on a varchar gains a cast per element), so a check created from it would differ again on the next status, while one created from the model's text is exactly the one the comparison probed, as a frozen migration's is.