Skip to main content

Module mode_detection

Module mode_detection 

Source
Expand description

Request-shape validation for the ranked query, and the versioned (select, group_by, order_by, limit, offset)DocumentRankedMode resolution.

Pure functions on the request shape — no Drive, no contract, no indexes. Available under server (the dispatcher validates before executing) and verify (the SDK validates the same way before attempting proof verification), so both sides agree on which requests are well-formed and on the (axis, descending, k, offset) tuple a well-formed one resolves to. Index-dependent validation (“does an index actually cover this axis?”) needs the document type’s index map and lives in super::index_picker.

Versioned through platform_version.drive.methods.document.query.detect_ranked_mode, the same way DriveDocumentCountQuery::detect_mode_versioned routes count’s table: the accepted request grammar is a consensus- adjacent contract on the query surface, so relaxing it later has to land behind a method-version bump rather than changing what an already-deployed protocol version accepts.

Functions§

detect_ranked_mode
Versioned entry point. Routes through platform_version.drive.methods.document.query.detect_ranked_mode; today only 0 is defined and maps to detect_ranked_mode_v0 verbatim.
detect_ranked_mode_v0
v0 of the ranked request grammar.
prefix_pins_from_where_clauses
Translate a request’s where clauses into prefix pins — one PrefixPin per clause, carrying the pinned property and its value(s): one value from an == clause, several from the (at most one) IN — for the ranked and having-range surfaces.
ranked_order_key
The ORDER BY field name that names a given select’s aggregate.