Expand description
Shared where-clause validation + canonicalization for the aggregate query surfaces (count / sum / average / joint count-and-sum) and their SDK proof verifiers.
Lives outside the per-surface dispatcher modules because the shape contract must be identical on every route: the server dispatchers canonicalize before mode detection, and the proof verifiers must run the very same canonicalization before their mode detection or a proof the server produced for the canonical shape is rejected client-side (the count dispatcher promises callers “the bounded form and the pre-merged form get equivalent mode detection” — that promise only holds if verifiers canonicalize too).
Functions§
- key_
array_ element_ clauses - Key the clauses of a count, sum, average, ranked or having request that read
the elements of a typed array (protocol version 14) as the index levels of
the array are keyed:
containsas an equality on one element’s key,containsAnyas aninover several. The aggregate surfaces then serve them as any equality orin, each element a group of its own. Every other clause passes through unchanged. - validate_
and_ canonicalize_ where_ clauses - Run the system-wide where-clause validator on a structured
Vec<WhereClause>and canonicalize same-field range pairs into theirbetween*form. Single source of truth for the aggregate shape contract; called by the count / sum / average / joint dispatchers, the legacy CBOR-decoded count entry, and the SDK count / sum / average proof verifiers.