Reconcile detects and repairs inconsistencies between the virtual state store and the actual warehouse objects.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.
Report
Run reconcile without a subcommand to get a diagnostic report:Repair view
Recreate a logical VDE view from trusted state:CREATE OR REPLACE VIEW for the logical VDE view, pointing it at the physical version relation recorded in the VDE’s refs. It is idempotent - running it when the view is already correct is a no-op.
Guards
| Condition | Behavior |
|---|---|
| Logical target is a table (not a view) | Blocks. Drop the table manually first, then retry. |
| Physical relation is missing | Blocks. Rebuild the model with sqb build --select <model>. |
| Target VDE is locked | Blocks. Wait or clear the lock. |
Attach
Rebind a VDE model ref to a different tracked physical relation:fact_orders to point at the specified physical relation and refreshes the logical view.
Guards
| Condition | Behavior |
|---|---|
| Physical relation not tracked in state | Blocks. Only physical relations registered in SQLBuild state can be attached. |
| Physical relation tracked for a different model | Blocks. Cannot attach a relation that belongs to another model. |
| Logical target is a table (not a view) | Blocks. |
| Target VDE is locked | Blocks. |
| Wrong confirmation | Blocks. Refs remain unchanged. |
When to use reconcile
- Missing logical views after a failed build, promotion, or detach - use
repair-view - Wrong physical version if a VDE ref was corrupted or you need to manually override which version a model points to - use
attach - Diagnostic inspection before or after recovery operations - use the default report
reconcile_events state table for audit trail.
Limitations
Reconcile repairs pointer/view state. It does not rebuild physical versions. If a physical relation is missing from the warehouse, the only remedy is rebuilding the model withsqb build --select <model>.
