Documentation
¶
Overview ¶
Package query parses and checks the list query language (where, order_by) against a collection's schema, producing backend-neutral storage conditions. Client input never reaches the database as-is: only the operators below exist, and every field and value is checked.
Index ¶
Constants ¶
const ( MaxWhereBytes = 4096 // size of the raw where parameter MaxConditions = 32 // operator clauses in where MaxTextLen = 256 // value length for text operators MaxLikeWildcards = 4 // % and _ in a $like / $ilike pattern MaxSortFields = 8 // fields in order_by MaxGroupDepth = 4 // nesting of $or / $and groups )
Limits on query complexity.
Variables ¶
This section is empty.
Functions ¶
func ParseCount ¶
ParseCount parses the count parameter ("", "true" or "false").
func ParseOrderBy ¶
ParseOrderBy parses a comma-separated field list with an optional "-" prefix for descending order. An "id" tiebreaker is appended unless id is already present, so pagination is stable. Empty means id ascending.
func ParseWhere ¶
ParseWhere parses the where parameter (a JSON object) into a filter tree: the object's keys combine with AND, and "$or" / "$and" take an array of where objects. An empty string or object means no filter (nil). Keys are processed in sorted order, so the result is deterministic.