Skip to main content

Module query_parse

Module query_parse 

Source
Expand description

Parsing the where parameter.

A where value is {"field": <literal>} for equality, or {"field": {"$op": <value>}} for everything else. An operator document may carry several operators, which is how a range is expressed. $or, $and, $nor and $relatedTo are query-level keys rather than field names.

Anything unsupported is an error. Silently ignoring an operator returns more rows than the caller asked for, which is an authorization failure rather than a missing feature, and it is the failure mode this rule exists to prevent. The vocabulary grew at 0.2.0; the rule did not relax.

The output is a ParsedWhere rather than a Query, because two constructs cannot be lowered without reading the database: $relatedTo and a constraint on a Relation-typed field are both join-table reads. They stay as nodes here and are resolved by crate::relations once a schema and a caller are known.

Structs§

ParsedWhere
A parsed where document: a conjunction of clauses.

Enums§

ParsedClause
One element of a parsed where.

Constants§

CLIENT_QUERYABLE_INTERNAL_FIELDS
Internal columns a client may name in a query (clientRead, DatabaseController.js:31-44).
MASTER_QUERYABLE_INTERNAL_FIELDS
Internal columns the master key may additionally name (masterRead).
MAX_INCLUDE_DEPTH
The deepest pointer chain an include may name. See parse_include.
MAX_INCLUDE_PATHS
The most distinct include paths one request may produce, counting expanded prefixes. See parse_include.

Functions§

parse_include
Parse the include parameter into paths, every prefix materialized and sorted by depth.
parse_where
Parse a decoded where object.
validate_query_keys
The key-name half of validateQuery (DatabaseController.js:161-188).