Expected COALESCE facts are assertions only.
Honest by construction
Expected COALESCE facts are assertions only.
compiler is source of truth \text{compiler is source of truth} compiler is source of truth
Render checked rows
The guarded COALESCE expression renders 4 output rows after recomputation.
checked rows = 4 \text{checked rows}=4 checked rows = 4
COALESCE examples are tiny finite row transforms with SQL-style NULL choice behavior; SQL dialect completeness, type coercion, optimizer behavior, indexing, and product claims are out of scope.
Honest by construction: base rows name email backup nickname Ada ada@example ada@backup NULL Bea NULL bea@backup B Cal NULL NULL Cal Dee NULL NULL NULL
COALESCE argument choice source arg values chosenIndex result resultSource 0 [ada@example, ada@backup, missing] 0 ada@example email 1 [NULL, bea@backup, missing] 1 bea@backup backup 2 [NULL, NULL, missing] 2 missing literal 3 [NULL, NULL, missing] 2 missing literal
COALESCE output rows name email backup nickname contact Ada ada@example ada@backup NULL ada@example Bea NULL bea@backup B bea@backup Cal NULL NULL Cal missing Dee NULL NULL NULL missing
COALESCE facts fact value inputRowCount 4 argCount 3 outputRowCount 4 firstArgRows 1 fallbackRows 3 literalDefaultRows 2 allNullRows 0 rowOrder source_order whereContrast value_choice_not_truth_filter
Try to tamper
Wrong expected facts, derived sidecars, duplicate aliases, missing columns, bools, floats, and unsupported arguments fail closed.
tamper rejected \text{tamper rejected} tamper rejected
Summary
The book shows exact finite COALESCE behavior only; product SQL behavior is outside the model.
scoped COALESCE model \text{scoped COALESCE model} scoped COALESCE model