Skip to main content

value_fits_affinity

Function value_fits_affinity 

Source
pub fn value_fits_affinity(value: &Value, affinity: Affinity) -> bool
Expand description

Whether a carved value is storage-compatible with a column of the given declared affinity — the per-cell test the shape matcher applies.

Rules (permissive enough to survive SQLite’s numeric coercions, strict enough to discriminate tables of equal arity but different type layout): a NULL is compatible with anything; INTEGER/REAL are mutually compatible and also satisfy NUMERIC; TEXT requires a text-leaning affinity (TEXT) or the catch-all BLOB/NUMERIC; a BLOB requires BLOB. The BLOB affinity (or a column with no declared type) accepts any value, matching SQLite’s “no datatype” semantics.