Expected UNIQUE facts are assertions only.

highlighted = computed this step

Honest by construction

Expected UNIQUE facts are assertions only.

compiler is source of truth\text{compiler is source of truth}

Render checked facts

The guarded UNIQUE rule renders 1 checked violation after recomputation.

checked violations=1\text{checked violations}=1

UNIQUE constraint examples are tiny finite table checks; SQL dialect completeness, index implementation, locking, optimizer behavior, product behavior, and performance claims are out of scope.

Honest by construction: base rowsidemailregionplan1adaeastbasic2beneastpro3adawestbasic4NULLeasttrial5NULLwesttrial6cyeastbasic UNIQUE rulenamecolumnsuq_email(email) UNIQUE keys by source rowsourceinputkeykeyStatus0(1, ada, east, basic)(ada)checkable1(2, ben, east, pro)(ben)checkable2(3, ada, west, basic)(ada)checkable3(4, NULL, east, trial)(NULL)NULL_component_does_not_collide4(5, NULL, west, trial)(NULL)NULL_component_does_not_collide5(6, cy, east, basic)(cy)checkable UNIQUE violationsleftrightkeyreason02(ada)duplicate_non_NULL_key Insert candidate checkfieldvaluepresentno UNIQUE factsfactvaluerowCount6constraintNameuq_emailkeyColumnCount1violationCount1tableValidnonullsCollideno_toy_SQL_like_conventioncandidateDecisionnone

Try to tamper

Wrong expected facts, derived sidecars, missing or duplicate columns, too many key columns, malformed candidates, bools, and floats fail closed.

tamper rejected\text{tamper rejected}

Summary

This book shows exact finite UNIQUE key checks only.

scoped UNIQUE model\text{scoped UNIQUE model}