Expand description
Live-database work for CLI commands: planning and applying migrations,
planning and applying push, and introspection.
Each entry point dispatches on the resolved credentials to whichever driver features were compiled in.
Structs§
- Introspect
Result - What
run_introspectionproduced. - Migration
Plan - Planned migration execution details.
- Migration
Result - What
run_migrationsdid. - Push
Plan - SQL that
drizzle pushwould run, fromplan_push. - Snapshot
Filters - Optional filters for introspection and push planning.
Functions§
- apply_
push - Runs a
PushPlan, asking for confirmation first when it is destructive andforceisfalse. - apply_
snapshot_ filters - Apply table, schema, and extension filters to a snapshot in place.
- execute_
seed - Runs the statements of a seed in order, in one transaction where the driver supports it.
- introspect_
for_ seed - Reads the live schema for
drizzle seed: introspects the database, drops the migrations tracking table, and appliesfilters. - plan_
migrations - Compares local migrations with the database’s tracking table without
changing anything (
migrate --plan/--verify). - plan_
push - Plans a push: introspects the live database and diffs it against
desired. - plan_
push_ with_ renames plan_pushthat letsresolve_renamessettle rename-or-create questions before diffing.- run_
introspection - Introspects a database and writes
<out_dir>/schema.rsand a baseline<out_dir>/<tag>/folder (snapshot.jsonand amigration.sqlthat creates the whole schema). - run_
migrations - Applies the pending migrations in
migrations_dirand records them in the tracking table, creating or upgrading that table as needed.