Expand description
Per-mode count-query executors on impl Drive. One file per
super::DocumentCountMode variant — the dispatcher
(super::drive_dispatcher) calls into the right one based
on the detected mode.
Each executor:
- Picks the right covering index for its mode (returns
Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty)if no index covers the where clauses). - Builds the appropriate
DriveDocumentCountQuery. - Runs the matching method on it (
execute_no_proof,execute_range_count_no_proof,execute_aggregate_count_with_proof,execute_distinct_count_with_proof, orexecute_point_lookup_count_with_proof). - Returns
Vec<SplitCountEntry>(no-proof modes) orVec<u8>proof bytes (proof modes).
Splitting along mode boundaries — one file per mode — keeps
each executor’s index-picking + clause-handling logic local
and lets the dispatcher’s match arms stay one line each. No
re-exports are needed: each file adds methods directly to
impl Drive, so callers (the dispatcher) just see them on
the Drive type.
Modules§
- per_
in_ value - Per-
In-value executor forsuper::super::DocumentCountMode::PerInValuedispatch —prove = falsecount queries with exactly oneInclause and no range clause. - point_
lookup_ proof - Point-lookup count proof executor for
super::super::DocumentCountMode::PointLookupProofdispatch —prove = truecount queries with no range clause (Equal/Inagainst acountable: trueindex, OR thedocuments_countable: truefast path on empty where). - range_
aggregate_ carrier_ proof - Carrier-ACOR proof executor for
super::super::DocumentCountMode::RangeAggregateCarrierProofdispatch —prove = truecount queries where the caller asks for one aggregate per outer-key branch viagroup_by = [outer_field]. The outer dimension is either: - range_
distinct_ proof - Distinct-range-count proof executor for
super::super::DocumentCountMode::RangeDistinctProofdispatch —prove = truecount queries with a range clause and non-emptygroup_by. Emits per-distinct-valueKVCountops the client verifies via [drive_proof_verifier::verify_distinct_count_proof]. - range_
no_ proof - Range-count executor for
super::super::DocumentCountMode::RangeNoProofdispatch —prove = falsecount queries with a range clause. Returns a summed entry whenoptions.distinct = falseor per-distinct- value entries whenoptions.distinct = true. - range_
proof - Range-count proof executor for
super::super::DocumentCountMode::RangeProofdispatch —prove = truecount queries with a range clause and emptygroup_by. Uses grovedb’sAggregateCountOnRangeprimitive to emit a single u64 verified out of the proof. - total
- Total-count executor for
super::super::DocumentCountMode::Totaldispatch —prove = falsecount queries without a range clause.