pub struct Query<E>where
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> Query<E>where
E: EntityKind,
impl<E> Query<E>where
E: EntityKind,
Sourcepub const fn new(consistency: ReadConsistency) -> Query<E>
pub const fn new(consistency: ReadConsistency) -> Query<E>
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) -> Query<E>
pub fn filter(self, predicate: Predicate) -> Query<E>
Add a predicate, implicitly AND-ing with any existing predicate.
Sourcepub fn filter_expr(self, expr: FilterExpr) -> Result<Query<E>, QueryError>
pub fn filter_expr(self, expr: FilterExpr) -> Result<Query<E>, QueryError>
Apply a dynamic filter expression.
Sourcepub fn sort_expr(self, expr: SortExpr) -> Result<Query<E>, QueryError>
pub fn sort_expr(self, expr: SortExpr) -> Result<Query<E>, QueryError>
Apply a dynamic sort expression.
Sourcepub fn order_by_desc(self, field: impl AsRef<str>) -> Query<E>
pub fn order_by_desc(self, field: impl AsRef<str>) -> Query<E>
Append a descending sort key.
Sourcepub fn limit(self, limit: u32) -> Query<E>
pub fn limit(self, limit: u32) -> Query<E>
Apply a limit to the current mode.
Load limits bound result size; delete limits bound mutation size.
For load queries, any use of limit or offset requires an explicit
order_by(...) so pagination is deterministic.
Sourcepub fn offset(self, offset: u32) -> Query<E>
pub fn offset(self, offset: u32) -> Query<E>
Apply an offset to a load intent.
Any use of offset or limit requires an explicit order_by(...).
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.