pub struct Query {Show 29 fields
pub match_clauses: Vec<MatchClause>,
pub where_clause: Option<WhereClause>,
pub return_clause: Option<ReturnClause>,
pub create_clause: Option<CreateClause>,
pub order_by: Option<OrderByClause>,
pub limit: Option<usize>,
pub skip: Option<usize>,
pub call_clause: Option<CallClause>,
pub call_subquery: Option<Box<Query>>,
pub delete_clause: Option<DeleteClause>,
pub set_clauses: Vec<SetClause>,
pub remove_clauses: Vec<RemoveClause>,
pub with_clause: Option<WithClause>,
pub create_vector_index_clause: Option<CreateVectorIndexClause>,
pub create_index_clause: Option<CreateIndexClause>,
pub drop_index_clause: Option<DropIndexClause>,
pub create_constraint_clause: Option<CreateConstraintClause>,
pub show_indexes: bool,
pub show_constraints: bool,
pub profile: bool,
pub params: HashMap<String, PropertyValue>,
pub foreach_clause: Option<ForeachClause>,
pub unwind_clause: Option<UnwindClause>,
pub merge_clause: Option<MergeClause>,
pub union_queries: Vec<(Query, bool)>,
pub explain: bool,
pub with_split_index: Option<usize>,
pub post_with_where_clause: Option<WhereClause>,
pub extra_with_stages: Vec<(WithClause, Option<UnwindClause>, Vec<MatchClause>, Option<WhereClause>)>,
}Expand description
The root AST node representing a complete Cypher query.
Every parsed Cypher statement produces exactly one Query. Its fields are grouped
into four logical categories:
-
Pattern matching:
match_clauses,where_clause,post_with_where_clause– these define what to find in the graph (nodes, edges, paths, filters). -
Mutations:
create_clause,delete_clause,set_clauses,remove_clauses,merge_clause,foreach_clause– these modify graph state. When any of these are present, the planner setsExecutionPlan::is_write = true, which routes execution throughMutQueryExecutor(requiring&mut GraphStore). -
Projection and ordering:
return_clause,order_by,skip,limit,with_clause– these shape the output (column selection, sorting, pagination).WITHacts as a pipeline barrier: it materializes intermediate results and introduces a new scope, similar to a subquery in SQL. -
Schema and introspection:
create_index_clause,drop_index_clause,create_constraint_clause,show_indexes,show_constraints,explain,profile– these are DDL/DML operations and diagnostic flags.
Fields§
§match_clauses: Vec<MatchClause>MATCH clauses
where_clause: Option<WhereClause>WHERE clause (optional)
return_clause: Option<ReturnClause>RETURN clause (optional)
create_clause: Option<CreateClause>CREATE clause (optional)
order_by: Option<OrderByClause>ORDER BY clause (optional)
limit: Option<usize>LIMIT clause (optional)
skip: Option<usize>SKIP clause (optional)
call_clause: Option<CallClause>CALL clause (optional)
call_subquery: Option<Box<Query>>CALL subquery (optional)
delete_clause: Option<DeleteClause>DELETE clause (optional)
set_clauses: Vec<SetClause>SET clauses
remove_clauses: Vec<RemoveClause>REMOVE clauses
with_clause: Option<WithClause>WITH clause (optional)
create_vector_index_clause: Option<CreateVectorIndexClause>CREATE VECTOR INDEX clause (optional)
create_index_clause: Option<CreateIndexClause>CREATE INDEX clause (optional)
drop_index_clause: Option<DropIndexClause>DROP INDEX clause (optional)
create_constraint_clause: Option<CreateConstraintClause>CREATE CONSTRAINT clause (optional)
show_indexes: boolSHOW INDEXES flag
show_constraints: boolSHOW CONSTRAINTS flag
profile: boolPROFILE flag
params: HashMap<String, PropertyValue>Query parameters
foreach_clause: Option<ForeachClause>FOREACH clause (optional)
unwind_clause: Option<UnwindClause>UNWIND clause (optional)
merge_clause: Option<MergeClause>MERGE clause (optional)
union_queries: Vec<(Query, bool)>UNION queries (chained via UNION/UNION ALL)
explain: boolEXPLAIN clause (optional)
with_split_index: Option<usize>Index into match_clauses where WITH clause splits pre-WITH from post-WITH. match_clauses[..split] belong to pre-WITH, match_clauses[split..] to post-WITH.
post_with_where_clause: Option<WhereClause>Post-WITH WHERE clause (second WHERE after WITH … MATCH … WHERE …)
extra_with_stages: Vec<(WithClause, Option<UnwindClause>, Vec<MatchClause>, Option<WhereClause>)>Additional WITH stages (for multi-WITH queries like WITH … MATCH … WITH … RETURN) Each stage: (with_clause, unwind_clause, post_match_clauses, post_where_clause)
Implementations§
Trait Implementations§
impl StructuralPartialEq for Query
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Query
impl UnwindSafe for Query
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more