Expand description
SELECT projection types for the v1 getDocuments surface.
The projection determines what the response carries:
SelectFunction::Documents: matched rows (ResultData.documents).SelectFunction::Count: row counts — single aggregate whengroup_byis empty, per-group entries otherwise.SelectFunction::Sum/SelectFunction::Avg: numeric aggregate(s) of a named field — same single/per-group shape contract asCount.
Per-function field requirements live in
SelectProjection::field; the type itself just carries the
(function, field) pair.
Shared between the wire-decoding layer
(rs-drive-abci/src/query/document_query/v1/conversions.rs)
and the SDK’s request builder
(rs-sdk/src/platform/documents/document_query.rs). Server
capability today: SelectFunction::Documents,
SelectFunction::Count with empty field (= COUNT(*)),
SelectFunction::Sum, and SelectFunction::Avg route
through the drive count / sum / average dispatchers and are
evaluated end-to-end (no-proof and proof paths).
SelectFunction::Count with non-empty field (=
COUNT(field)), SelectFunction::Min, and
SelectFunction::Max are wire-stable but rejected at routing
time with QuerySyntaxError::Unsupported("SELECT … is not yet implemented") — the surface is shipped first so callers can
encode against it, with execution landing later without
another version bump.
Structs§
- Select
Projection (function, field)projection. Thefieldsemantics depend onfunction:
Enums§
- Select
Function - Projection function applied by
SELECT. Distinct fromcrate::query::HavingAggregateFunctionbecause this enum carries the document-fetch branch too —SELECTmay return rows, not just aggregates — so the two can’t share a type.