Skip to main content

Query

Struct Query 

Source
pub struct Query {
    pub parts: Vec<SingleQuery>,
    pub union_all: Vec<bool>,
    pub next: Option<Box<Query>>,
}

Fields§

§parts: Vec<SingleQuery>§union_all: Vec<bool>

union_all[i] applies between parts[i] and parts[i+1].

§next: Option<Box<Query>>

CIP-213 sequential statement composition.

Implementations§

Source§

impl Query

Source

pub fn final_stage_projects_rows(&self, verdict: &ConcludingVerdict) -> bool

Whether this query’s FINAL stage projects a statement result of its own under a layer’s ConcludingVerdict — the one shared body-descent skeleton (ADR-0740): the FINAL-stage cursor (a NEXT-chained body is judged by its final stage, never its first), the any-arm fold over the stage’s UNION arms, and the hand-off of each arm’s concluding clause to the verdict, which receives this same descent back for the clause’s nested bodies. The structural invariants are surfaced here, never defaulted over: a Query invariantly carries at least one part, and a part at least one clause (validation refuses an empty part before any fold runs).

Two verdicts ride this one skeleton, and their agreement is the skeleton’s contract: the naming layer’s (Query::projects_columns: RETURN-only vocabulary with a first-branch stand-in) and the executor’s (the planner’s full clause table with any-branch breadth and its batched-call ruling). The two answer alike on every valid body — validation holds every WHEN branch and UNION arm to the same export shape, so the representative and the any-branch folds cannot disagree — and a new nested-body arm added to one verdict needs its twin arm in the other; the agreement test beside the executor’s verdict pins it.

Source

pub fn projects_columns(&self) -> bool

Whether this query projects columns: its true final stage (the end of its NEXT chain, not merely its own part list) ends in a RETURN, or in a CONDITIONAL / nested CALL { … } that projects. A body that does not — an update clause, a bare procedure call — leaves a CALL { … } a unit subquery.

The one IR spelling of the fact: the planner’s subquery-scope fold and the redundant-OPTIONAL notification detector both read it. The body-descent structure under it — the FINAL-stage cursor, the any-arm fold, the concluding-clause hand-off — is the one shared body-descent skeleton (Query::final_stage_projects_rows, ADR-0740); this method is the naming layer’s verdict over that skeleton ([projects_columns_concluding]), where the executor injects its own (the planner’s full clause table with any-branch breadth and the batched-call ruling) — the two agree on every nested-body shape under the validated branch/arm representative agreement.

Source§

impl Query

Source

pub fn final_stage(&self) -> &Query

The end of this query’s NEXT chain — its true terminal stage (CIP-213), not its own first stage. UNION arms are parts inside one Query, so the chain walk needs no union guard. The one IR-level spelling of the cursor the planner’s projection checks and the executor’s stage handling mirror.

Source

pub fn is_single_flat_part(&self) -> bool

Whether this query is one flat part with no NEXT stage — no UNION arms, no stage chain. The one IR spelling of the fact, read by the subquery fast paths that need a single clause list (the import-invariant shared execution, the IN TRANSACTIONS batch pass, ADR-0669), so none re-spells the two conjuncts.

Trait Implementations§

Source§

impl Clone for Query

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Query

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Query

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Query

Auto Trait Implementations§

§

impl Forget for Query

§

impl Freeze for Query

§

impl Move for Query

§

impl RefUnwindSafe for Query

§

impl Send for Query
where RawVecInner: Send, BoxRaw<Clause>: Send, Arc<str>: Send, BoxRaw<Expr>: Send, BoxRaw<LabelExpr>: Send, Arc<Vec<Value>>: Send, Arc<BTreeMap<String, Value>>: Send, Arc<Node>: Send, Arc<Relationship>: Send, Arc<Path>: Send, NonZero<i32>: Send, BoxRaw<CivilZonedFields>: Send, Arc<[f32]>: Send, Arc<[f64]>: Send, Arc<[i64]>: Send, Arc<[u8]>: Send, BoxRaw<TypeExpr>: Send, BoxRaw<SearchClause>: Send, BoxRaw<Query>: Send,

§

impl Sync for Query
where RawVecInner: Sync, BoxRaw<Clause>: Sync, Arc<str>: Sync, BoxRaw<Expr>: Sync, BoxRaw<LabelExpr>: Sync, Arc<Vec<Value>>: Sync, Arc<BTreeMap<String, Value>>: Sync, Arc<Node>: Sync, Arc<Relationship>: Sync, Arc<Path>: Sync, NonZero<i32>: Sync, BoxRaw<CivilZonedFields>: Sync, Arc<[f32]>: Sync, Arc<[f64]>: Sync, Arc<[i64]>: Sync, Arc<[u8]>: Sync, BoxRaw<TypeExpr>: Sync, BoxRaw<SearchClause>: Sync, BoxRaw<Query>: Sync,

§

impl Unpin for Query

§

impl UnsafeUnpin for Query

§

impl UnwindSafe for Query

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.