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>
impl<E: EntityKind> Query<E>
Sourcepub const fn new(consistency: ReadConsistency) -> Self
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.
Sourcepub fn filter(self, predicate: Predicate) -> Self
pub fn filter(self, predicate: Predicate) -> Self
Add a predicate, implicitly AND-ing with any existing predicate.
Sourcepub fn filter_expr(self, expr: FilterExpr) -> Result<Self, QueryError>
pub fn filter_expr(self, expr: FilterExpr) -> Result<Self, QueryError>
Apply a dynamic filter expression.
Sourcepub fn sort_expr(self, expr: SortExpr) -> Result<Self, QueryError>
pub fn sort_expr(self, expr: SortExpr) -> Result<Self, QueryError>
Apply a dynamic sort expression.
Sourcepub fn order_by_desc(self, field: impl AsRef<str>) -> Self
pub fn order_by_desc(self, field: impl AsRef<str>) -> Self
Append a descending sort key.
Sourcepub const fn limit(self, limit: u32) -> Self
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.
Sourcepub fn explain(&self) -> Result<ExplainPlan, QueryError>
pub fn explain(&self) -> Result<ExplainPlan, QueryError>
Explain this intent without executing it.
Sourcepub fn plan(&self) -> Result<ExecutablePlan<E>, QueryError>
pub fn plan(&self) -> Result<ExecutablePlan<E>, QueryError>
Plan this intent into an executor-ready plan.
Trait Implementations§
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> 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
Mutably borrows from an owned value. Read more