pub fn rewrite_query(query: Query) -> Result<Query, RewriteError>Expand description
Rewrite a complete query
This is the main entry point for applying query rewrites. It walks the entire query tree and applies registered rewrite rules to all function calls.
§Arguments
query- The query to rewrite
§Returns
The rewritten query with function calls transformed into predicates.
§Example
ⓘ
let query = parse_cypher("MATCH (p)-[e:EMPLOYED_BY]->(c) WHERE uni.temporal.validAt(e, 'start', 'end', datetime('2021-06-15')) RETURN c")?;
let rewritten = rewrite_query(query)?;
// The validAt function will be transformed into: e.start <= ... AND (e.end IS NULL OR e.end >= ...)