Skip to main content

Module query

Module query 

Source
Expand description

Collection query parsing (specification sections 6.2 - 6.4).

Turns the reserved query parameters (limit, offset, sort, fields) and the free-form field filters of a request URL into a structured query.

Structs§

CollectionQuery
A parsed collection query.
Filter
One field filter: a name and the value, or values, it must equal.
QueryParams
The query parameters of a request, in the order they were sent.
SortKey
One ordering key of a collection query.

Constants§

DEFAULT_LIMIT
Page size used when a request does not ask for one.
MAX_LIMIT
Largest page a server will serve, whatever the request asks for.
RESERVED_QUERY_PARAMETERS
Query parameters that are not field filters.

Functions§

form_decode
Decode one query component, reading + as a space.
form_encode
Percent-encode one query component the way a form does, with + for a space.
parse_bounded_integer
Parse a bounded non-negative integer query parameter.
parse_collection_query
Parse a full collection query from request query parameters.
parse_fields
Parse a fields parameter into a sparse fieldset.
parse_scalar
Parse a filter value with the Links Notation scalar rules.
parse_sort
Parse a sort parameter into ordered sort keys.