pub struct OrderByClause {
pub field: FieldRef,
pub expr: Option<Expr>,
pub ascending: bool,
pub nulls_first: bool,
}Expand description
Order by clause.
Fase 2 migration: field is the legacy bare column reference and
remains populated for back-compat with existing callers (SPARQL /
Gremlin / Cypher translators, the planner cost model, etc.). The
new expr slot carries an arbitrary Expr tree — when present,
runtime comparators prefer it over field, so the parser can
emit ORDER BY CAST(a AS INT), ORDER BY a + b * 2, etc. without
breaking the rest of the codebase.
When expr is None, the clause behaves exactly like before.
When expr is Some(Expr::Column(f)), runtime code may still use
the legacy path — it’s equivalent. Constructors default expr to
None so all existing call sites stay source-compatible.
Fields§
§field: FieldRefField to order by. Left populated even when expr is set so
legacy consumers (planner cardinality estimate, cost model,
mode translators) that still pattern-match on field keep
working during the Fase 2 migration.
expr: Option<Expr>Fase 2 expression-aware sort key. When Some, runtime order
comparators evaluate this expression per row and sort on the
resulting values — unlocks ORDER BY expr (Fase 1.6).
ascending: boolAscending or descending
nulls_first: boolNulls first or last
Implementations§
Source§impl OrderByClause
impl OrderByClause
Sourcepub fn asc(field: FieldRef) -> OrderByClause
pub fn asc(field: FieldRef) -> OrderByClause
Create ascending order
Sourcepub fn desc(field: FieldRef) -> OrderByClause
pub fn desc(field: FieldRef) -> OrderByClause
Create descending order
Sourcepub fn with_expr(self, expr: Expr) -> OrderByClause
pub fn with_expr(self, expr: Expr) -> OrderByClause
Attach an Expr sort key to an existing clause. Leaves field
untouched so back-compat match sites keep their pattern.
Trait Implementations§
Source§impl Clone for OrderByClause
impl Clone for OrderByClause
Source§fn clone(&self) -> OrderByClause
fn clone(&self) -> OrderByClause
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for OrderByClause
impl RefUnwindSafe for OrderByClause
impl Send for OrderByClause
impl Sync for OrderByClause
impl Unpin for OrderByClause
impl UnsafeUnpin for OrderByClause
impl UnwindSafe for OrderByClause
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request