Skip to main content

sqb state

Manages the virtual mode state store lifecycle, locks, and checkpoints. Requires virtual_environments = true.

Usage

Subcommands

init

Create state tables in the configured schema.

migrate

Back up the current state schema and re-initialize state tables. Creates a backup schema (e.g. sqlbuild_state__backup_<id>) before re-initializing.

rollback

Restore state from a backup.

reset

Drop all state tables. Requires allow_reset = true in the target state config and --auto-approve on the command line.

adopt

Convert existing stateless warehouse relations into versioned physical relations with VDE views. Interactive only - requires typed confirmation.
See Adopt and Detach for details.

detach

Collapse a VDE back into stateless warehouse relations. Interactive only - requires typed confirmation. The VDE must be finalized.

locks

List active locks in the state store.

locks clear

Clear a stuck lock.
Only clear locks when you are certain the holding operation is no longer running.

checkpoints list

List finalized checkpoints for a VDE.

checkpoints show

Show the model refs stored in a checkpoint.

checkpoints diff

Diff current VDE refs against a checkpoint.