Summary
Add a PreparedQuery type that parses/plans a Cypher query once and executes it many times, especially with parameters.
Motivation
Repeatedly parsing the same query is unnecessary for application workloads. Prepared queries would also give users a natural home for parameterized execution.
Example API
let query = PreparedQuery::parse(
"MATCH (p:Person) WHERE p.name = $name RETURN p",
)?;
let rows = query.execute(&graph, params)?;
Suggested approach
- Wrap the planned
CypherQuery in a public PreparedQuery type.
- Add read execution from a prepared query.
- Later extend to mutation if appropriate.
- Integrate with the proposed parameter API.
Acceptance criteria
- A query can be parsed once and executed multiple times.
- Prepared query execution returns the same rows as
graph.cypher(...) for equivalent inputs.
- Prepared queries support parameterized execution once parameters exist.
Suggested labels: enhancement, performance, api
Suggested milestone: Generalize the API
Summary
Add a
PreparedQuerytype that parses/plans a Cypher query once and executes it many times, especially with parameters.Motivation
Repeatedly parsing the same query is unnecessary for application workloads. Prepared queries would also give users a natural home for parameterized execution.
Example API
Suggested approach
CypherQueryin a publicPreparedQuerytype.Acceptance criteria
graph.cypher(...)for equivalent inputs.Suggested labels:
enhancement,performance,apiSuggested milestone: Generalize the API