pub enum Statement {
Create(Vec<Pattern>),
CreateIndex {
label: String,
prop: String,
unique: bool,
},
Explain(Box<Statement>),
Match {
clauses: Vec<QueryClause>,
tail: Option<Tail>,
order_by: Option<Vec<(ReturnExpr, SortDir)>>,
skip: Option<Box<ReturnExpr>>,
limit: Option<Box<ReturnExpr>>,
},
Union {
parts: Vec<Statement>,
all: bool,
},
StandaloneCall(Box<CallClause>),
}Variants§
Create(Vec<Pattern>)
CreateIndex
CREATE INDEX ON :Label(prop), optionally UNIQUE.
Explain(Box<Statement>)
EXPLAIN <statement> — describes the plan <statement> would run
(scan vs seek, pushdown applied) without executing any of it. Never
nests (the parser only ever wraps a create_index_stmt/
create_stmt/match_stmt, not another explain_stmt).
Match
Fields
clauses: Vec<QueryClause>One or more MATCH/UNWIND/MERGE ... [WITH ...] clauses. The
parser enforces every Match clause except the statement’s
last has a with before the next Match clause (matching real
Cypher’s rule that multiple reading clauses must be separated
by WITH) — Unwind/Merge clauses are exempt from this
specific check (they share one binding scope the same way
OPTIONAL MATCH already does, real Cypher needs no WITH around
a bare UNWIND/MERGE either) — and that at most one clause (of
any kind) has a with at all across the whole statement (v1
doesn’t support chaining past one WITH boundary — nothing in
the target query set needs it, and it keeps a hand-rolled
parser’s untested-path surface smaller).
tail: Option<Tail>None only when a MERGE clause is present with nothing after
it (MERGE (n:Label) alone, no RETURN/etc — a pure write,
same as standalone CREATE). The parser rejects a missing tail
otherwise (MATCH (n) alone is almost certainly a mistake, not
a deliberate no-op).
order_by: Option<Vec<(ReturnExpr, SortDir)>>Only meaningful for Tail::Return; evaluated against the
projected/aliased output row, not the raw pattern bindings —
every ORDER BY key in practice is a RETURN alias, not a bare
pattern variable.
Union
<match_stmt> UNION [ALL] <match_stmt> (UNION [ALL] <match_stmt>)*
— each parts entry is itself a Statement::Match, own scope, no
bindings shared across parts (real Cypher: a UNION member can’t see
a preceding member’s variables). all applies uniformly to the
whole statement — real Cypher rejects mixing bare UNION and
UNION ALL in one statement (a semantic check, parser:: parse_union_stmt, since it’s only checkable once every part’s own
UNION/UNION ALL keyword is in hand). false = dedup the
combined rows (UNION’s default); true = keep every row
(UNION ALL).
StandaloneCall(Box<CallClause>)
A bare CALL proc.name(args) [YIELD ...] with nothing else in the
statement (the grammar’s own standaloneCall, a top-level
alternative alongside regularQuery – never wrapped in
Statement::Match, since there’s no pattern to match at all). See
CallClause’s own docs for why args/yield_items mean something
subtly different here than in QueryClause::Call. Boxed (clippy’s
large_enum_variant) – CallClause is far bigger than
Statement’s other variants just for this rarely-taken one.
Trait Implementations§
impl StructuralPartialEq for Statement
Auto Trait Implementations§
impl Freeze for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnsafeUnpin for Statement
impl UnwindSafe for Statement
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer