Skip to main content

parse_query

Function parse_query 

Source
pub fn parse_query(text: &str) -> Result<QuerySpec, HaysonQueryParseError>
Expand description

Parses the WHERE-clause fragment of the SQL-like query language from ADR-0009 (cerebro ADR-6dk7) — a predicate expression combining comparisons with AND/OR and parentheses — followed by the optional ORDER BY <field> [ASC|DESC], LIMIT <n> and OFFSET <n>, in that order and at most once each. The fragment may be empty when at least one clause follows (ORDER BY name LIMIT 5); an empty text is still an error. SELECT/FROM/JOIN/MATCH and bound parameters are a separate, larger piece and are not covered here — see the query module’s TODO.