Skip to main content

Query

Struct Query 

Source
pub struct Query<E: EntityKind> { /* private fields */ }
Expand description

Query

Typed, declarative query intent for a specific entity type.

This intent is:

  • schema-agnostic at construction
  • normalized and validated only during planning
  • free of access-path decisions

Implementations§

Source§

impl<E: EntityKind> Query<E>

Source

pub const fn new(consistency: ReadConsistency) -> Self

Create a new intent with an explicit missing-row policy. MissingOk favors idempotency and may mask index/data divergence on deletes. Use Strict to surface missing rows during scan/delete execution.

Source

pub const fn mode(&self) -> QueryMode

Return the intent mode (load vs delete).

Source

pub fn filter(self, predicate: Predicate) -> Self

Add a predicate, implicitly AND-ing with any existing predicate.

Source

pub fn filter_expr(self, expr: FilterExpr) -> Result<Self, QueryError>

Apply a dynamic filter expression.

Source

pub fn sort_expr(self, expr: SortExpr) -> Result<Self, QueryError>

Apply a dynamic sort expression.

Source

pub fn order_by(self, field: impl AsRef<str>) -> Self

Append an ascending sort key.

Source

pub fn order_by_desc(self, field: impl AsRef<str>) -> Self

Append a descending sort key.

Source

pub const fn delete(self) -> Self

Mark this intent as a delete query.

Source

pub const fn limit(self, limit: u32) -> Self

Apply a limit to the current mode.

Load limits bound result size; delete limits bound mutation size.

Source

pub const fn offset(self, offset: u32) -> Self

Apply an offset to a load intent.

Source

pub fn explain(&self) -> Result<ExplainPlan, QueryError>

Explain this intent without executing it.

Source

pub fn plan(&self) -> Result<ExecutablePlan<E>, QueryError>

Plan this intent into an executor-ready plan.

Trait Implementations§

Source§

impl<E: Debug + EntityKind> Debug for Query<E>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<E> Freeze for Query<E>

§

impl<E> RefUnwindSafe for Query<E>
where E: RefUnwindSafe,

§

impl<E> Send for Query<E>
where E: Send,

§

impl<E> Sync for Query<E>
where E: Sync,

§

impl<E> Unpin for Query<E>
where E: Unpin,

§

impl<E> UnwindSafe for Query<E>
where E: UnwindSafe,

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> 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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V