Promotion copies model version refs from one VDE to another and refreshes the target’s logical views. No models are rebuilt - it is a pointer swap.Documentation Index
Fetch the complete documentation index at: https://docs.sqlbuild.com/llms.txt
Use this file to discover all available pages before exploring further.
Basic usage
dev to point at the same physical versions that VDE pr_123 uses. The target’s logical views (dev__dev.* or dev.* if unsuffixed) are refreshed to point at the promoted physical relations.
What happens during promotion
- Target VDE lock is acquired
- Source VDE is validated (finalized, current with workspace)
- Source model refs are copied to target VDE refs
- Source function refs are copied and function definitions are republished in the target schema
- Target logical VDE views are refreshed
- A checkpoint is created if the target is finalized
- Target VDE lock is released
Partial promotion
Promote a subset of models:--include-stale-upstreams to ensure coherent upstream lineage in the promoted scope:
Source VDE requirements
Whole promotion requires the source VDE to be finalized and current with the workspace (no stale models vs current code). If the source VDE has been built but the code has since changed, you need to rebuild the source VDE first or use partial promotion. Partial promotion does not require a finalized source. A working source VDE is allowed when using--select for a coherent scope.
Guards
| Condition | Behavior |
|---|---|
| Source VDE not finalized (whole promotion) | Blocks. Use --select for partial promotion from a working source. |
| Source VDE has stale models vs workspace | Blocks. Rebuild the source VDE or use --select. |
| Target VDE is locked | Blocks. Wait or clear the lock with sqb state locks clear. |
| Target VDE is detached | Blocks. Detached VDEs cannot be promoted to. |
| Source VDE is detached | Blocks. Detached VDEs cannot be promoted from. |
| Partial promotion leaves target working | Blocks unless --allow-partial-promotion is set. |
Comparing VDEs before promotion
Usesqb diff to compare VDE ref sets before promoting. See Diff for details.
