Rust Option Is Not Enough for Partially Loaded Entities
· 4 min read
Rust's Option<T> is one of the language's best tools. It forces absence into
the type system and eliminates an entire class of null-pointer failures.
But an ORM or data runtime has another state that Option<T> cannot express on
its own: the field was not loaded.
If both SQL NULL and an unselected column become None, business logic cannot
tell a legitimate absence from an incomplete query. TeaQL Rust models the
missing state explicitly with EvalResult::Value, EvalResult::Null, and
EvalResult::NotLoaded.
