pub struct FluentLoadQuery<'a, E>where
E: EntityKind,{ /* private fields */ }Expand description
FluentLoadQuery
Session-bound load query wrapper.
Owns intent construction and execution routing only.
All result inspection and projection is performed on Response<E>.
Implementations§
Source§impl<'a, E> FluentLoadQuery<'a, E>where
E: EntityKind,
impl<'a, E> FluentLoadQuery<'a, E>where
E: EntityKind,
pub const fn query(&self) -> &Query<E>
Sourcepub fn by_id(self, id: Id<E>) -> Self
pub fn by_id(self, id: Id<E>) -> Self
Set the access path to a single typed primary-key value.
Id<E> is treated as a plain query input value here. It does not grant access.
Sourcepub fn by_ids<I>(self, ids: I) -> Selfwhere
I: IntoIterator<Item = Id<E>>,
pub fn by_ids<I>(self, ids: I) -> Selfwhere
I: IntoIterator<Item = Id<E>>,
Set the access path to multiple typed primary-key values.
IDs are public and may come from untrusted input sources.
pub fn filter(self, predicate: Predicate) -> Self
pub fn filter_expr(self, expr: FilterExpr) -> Result<Self, QueryError>
pub fn sort_expr(self, expr: SortExpr) -> Result<Self, QueryError>
pub fn order_by(self, field: impl AsRef<str>) -> Self
pub fn order_by_desc(self, field: impl AsRef<str>) -> Self
Sourcepub fn limit(self, limit: u32) -> Self
pub fn limit(self, limit: u32) -> Self
Bound the number of returned rows.
Pagination is only valid with explicit ordering; combine limit and/or
offset with order_by(...) or planning fails.
Sourcepub fn offset(self, offset: u32) -> Self
pub fn offset(self, offset: u32) -> Self
Skip a number of rows in the ordered result stream.
Pagination is only valid with explicit ordering; combine offset and/or
limit with order_by(...) or planning fails.
Sourcepub fn cursor(self, token: impl Into<String>) -> Self
pub fn cursor(self, token: impl Into<String>) -> Self
Attach an opaque cursor token for continuation pagination.
Cursor-mode invariants are checked before planning/execution:
- explicit
order_by(...)is required - explicit
limit(...)is required
pub fn explain(&self) -> Result<ExplainPlan, QueryError>
pub fn plan(&self) -> Result<ExecutablePlan<E>, QueryError>
Sourcepub fn execute(&self) -> Result<Response<E>, QueryError>where
E: EntityValue,
pub fn execute(&self) -> Result<Response<E>, QueryError>where
E: EntityValue,
Execute this query using the session’s policy settings.
Sourcepub fn page(self) -> Result<PagedLoadQuery<'a, E>, QueryError>
pub fn page(self) -> Result<PagedLoadQuery<'a, E>, QueryError>
Enter typed cursor-pagination mode for this query.
Cursor pagination requires:
- explicit
order_by(...) - explicit
limit(...)
Requests are deterministic under canonical ordering, but continuation is best-effort and forward-only over live state. No snapshot/version is pinned across requests, so concurrent writes may shift page boundaries.
Sourcepub fn execute_paged(self) -> Result<(Response<E>, Option<Vec<u8>>), QueryError>where
E: EntityValue,
pub fn execute_paged(self) -> Result<(Response<E>, Option<Vec<u8>>), QueryError>where
E: EntityValue,
Execute this query as cursor pagination and return items + next cursor.
The returned cursor token is opaque and must be passed back via .cursor(...).
Sourcepub fn is_empty(&self) -> Result<bool, QueryError>where
E: EntityValue,
pub fn is_empty(&self) -> Result<bool, QueryError>where
E: EntityValue,
Execute and return whether the result set is empty.
Sourcepub fn exists(&self) -> Result<bool, QueryError>where
E: EntityValue,
pub fn exists(&self) -> Result<bool, QueryError>where
E: EntityValue,
Execute and return whether at least one matching row exists.
Sourcepub fn count(&self) -> Result<u32, QueryError>where
E: EntityValue,
pub fn count(&self) -> Result<u32, QueryError>where
E: EntityValue,
Execute and return the number of matching rows.
Sourcepub fn min(&self) -> Result<Option<Id<E>>, QueryError>where
E: EntityValue,
pub fn min(&self) -> Result<Option<Id<E>>, QueryError>where
E: EntityValue,
Execute and return the smallest matching identifier, if any.
Sourcepub fn max(&self) -> Result<Option<Id<E>>, QueryError>where
E: EntityValue,
pub fn max(&self) -> Result<Option<Id<E>>, QueryError>where
E: EntityValue,
Execute and return the largest matching identifier, if any.
Sourcepub fn first(&self) -> Result<Option<Id<E>>, QueryError>where
E: EntityValue,
pub fn first(&self) -> Result<Option<Id<E>>, QueryError>where
E: EntityValue,
Execute and return the first matching identifier in response order, if any.
Sourcepub fn last(&self) -> Result<Option<Id<E>>, QueryError>where
E: EntityValue,
pub fn last(&self) -> Result<Option<Id<E>>, QueryError>where
E: EntityValue,
Execute and return the last matching identifier in response order, if any.
Sourcepub fn require_one(&self) -> Result<(), QueryError>where
E: EntityValue,
pub fn require_one(&self) -> Result<(), QueryError>where
E: EntityValue,
Execute and require exactly one matching row.
Sourcepub fn require_some(&self) -> Result<(), QueryError>where
E: EntityValue,
pub fn require_some(&self) -> Result<(), QueryError>where
E: EntityValue,
Execute and require at least one matching row.