Expand description
Recursive-descent parser for the Cypher subset. Never panics on any token sequence.
Structs§
- Union
Query - A read query that may be a single query or a
UNION/UNION ALLchain.all_flags[i]istruewhen the boundary beforeparts[i + 1]wasUNION ALL(bag union);falseforUNION(distinct). Length isparts.len() - 1.
Functions§
- is_
write_ tokens - Return true if the token stream starts with a write keyword, or is a MATCH statement followed by SET or DELETE. Used for fast server-side dispatch without a full parse.
- parse
- Parse a tokenized Cypher subset query. Every failure is
Err(String); this function never panics on a well-formed&[Tok](including empty / garbage). - parse_
read - Parse a read query, accepting a
UNION/UNION ALLchain. - parse_
write - Parse a tokenized write statement (CREATE / MATCH…SET / MATCH…DELETE / MERGE).
Returns
Errfor read queries or malformed write statements.