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§
Sourcefn unique_keys(&self) -> Vec<Vec<ColId>>
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.)
Sourcefn lookup_unique(&self, bound: &[(ColId, OwnedValue)]) -> Option<OwnedRow>
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).