Rindle docs and package mapSkip to main content

ScalarSource

Trait ScalarSource 

Source
pub trait ScalarSource {
    // Required methods
    fn schema(&self) -> &Schema;
    fn unique_keys(&self) -> Vec<Vec<ColId>>;
    fn lookup_unique(&self, bound: &[(ColId, OwnedValue)]) -> Option<OwnedRow>;
}
Expand description

The per-table read seam the resolver uses to fold a statically-unique subquery. One impl per source backend; MemorySource provides the PK-only slice impl.

Required Methods§

Source

fn schema(&self) -> &Schema

The child table’s schema (column names → ColId, primary key).

Source

fn unique_keys(&self) -> Vec<Vec<ColId>>

The statically-unique key column sets, PK first. Empty ⇒ nothing here is foldable. (Slice: PK only; SQLite pragma_index_xinfo discovery is a follow-up — design §4.1.)

Source

fn lookup_unique(&self, bound: &[(ColId, OwnedValue)]) -> Option<OwnedRow>

The single row in which every (ColId, value) of bound holds. The caller guarantees bound covers one of Self::unique_keys, so the result is unique. None ⇒ no row matches (the empty-result fold).

Implementors§