pub struct SessionLoadQuery<'a, C: CanisterKind, E: EntityKind<Canister = C>> { /* private fields */ }Expand description
SessionLoadQuery
Fluent, session-bound load query wrapper that keeps intent pure
while routing execution through the DbSession boundary.
Implementations§
Source§impl<'a, C: CanisterKind, E: EntityKind<Canister = C>> SessionLoadQuery<'a, C, E>
impl<'a, C: CanisterKind, E: EntityKind<Canister = C>> SessionLoadQuery<'a, C, E>
Sourcepub fn many<I>(self, keys: I) -> Selfwhere
I: IntoIterator<Item = E::PrimaryKey>,
pub fn many<I>(self, keys: I) -> Selfwhere
I: IntoIterator<Item = E::PrimaryKey>,
Load multiple entities by primary key.
Semantics:
- Equivalent to
WHERE pk IN (…) - Uses key-based access (ByKey / ByKeys)
- Missing keys are ignored in MissingOk mode
- Strict mode treats missing rows as corruption
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 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 fn explain(&self) -> Result<ExplainPlan, QueryError>
pub fn explain(&self) -> Result<ExplainPlan, QueryError>
Explain this query without executing it.
Sourcepub fn plan(&self) -> Result<ExecutablePlan<E>, QueryError>
pub fn plan(&self) -> Result<ExecutablePlan<E>, QueryError>
Plan this query into an executor-ready plan.
Sourcepub fn execute(&self) -> Result<Response<E>, QueryError>
pub fn execute(&self) -> Result<Response<E>, QueryError>
Execute this query using the session’s policy settings.
Sourcepub fn exists(&self) -> Result<bool, QueryError>
pub fn exists(&self) -> Result<bool, QueryError>
Return whether any rows match this query.
Sourcepub fn count(&self) -> Result<u64, QueryError>
pub fn count(&self) -> Result<u64, QueryError>
Execute and return the number of matching rows.
Sourcepub fn all(&self) -> Result<Vec<E>, QueryError>
pub fn all(&self) -> Result<Vec<E>, QueryError>
Execute and return all entities.
Sourcepub fn views(&self) -> Result<Vec<View<E>>, QueryError>
pub fn views(&self) -> Result<Vec<View<E>>, QueryError>
Execute and return all results as views.
Sourcepub fn one(&self) -> Result<E, QueryError>
pub fn one(&self) -> Result<E, QueryError>
Execute and require exactly one entity.
Sourcepub fn view(&self) -> Result<View<E>, QueryError>
pub fn view(&self) -> Result<View<E>, QueryError>
Execute and require exactly one view.
Sourcepub fn one_opt(&self) -> Result<Option<E>, QueryError>
pub fn one_opt(&self) -> Result<Option<E>, QueryError>
Execute and return zero or one entity.
Source§impl<C: CanisterKind, E: EntityKind<Canister = C, PrimaryKey = ()>> SessionLoadQuery<'_, C, E>
impl<C: CanisterKind, E: EntityKind<Canister = C, PrimaryKey = ()>> SessionLoadQuery<'_, C, E>
Auto Trait Implementations§
impl<'a, C, E> Freeze for SessionLoadQuery<'a, C, E>
impl<'a, C, E> !RefUnwindSafe for SessionLoadQuery<'a, C, E>
impl<'a, C, E> !Send for SessionLoadQuery<'a, C, E>
impl<'a, C, E> !Sync for SessionLoadQuery<'a, C, E>
impl<'a, C, E> Unpin for SessionLoadQuery<'a, C, E>where
E: Unpin,
impl<'a, C, E> UnsafeUnpin for SessionLoadQuery<'a, C, E>
impl<'a, C, E> !UnwindSafe for SessionLoadQuery<'a, C, E>
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