pub struct SessionDeleteQuery<'a, C: CanisterKind, E: EntityKind<Canister = C>> { /* private fields */ }Expand description
SessionDeleteQuery
Fluent, session-bound delete query wrapper that keeps query intent pure
while routing execution through the DbSession boundary.
Implementations§
Source§impl<'a, C: CanisterKind, E: EntityKind<Canister = C>> SessionDeleteQuery<'a, C, E>
impl<'a, C: CanisterKind, E: EntityKind<Canister = C>> SessionDeleteQuery<'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>,
Delete 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 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 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 delete using the session’s policy settings.
Sourcepub fn is_empty(&self) -> Result<bool, QueryError>
pub fn is_empty(&self) -> Result<bool, QueryError>
Execute and return whether the response is empty.
Sourcepub fn count(&self) -> Result<u32, QueryError>
pub fn count(&self) -> Result<u32, QueryError>
Execute and return the number of affected rows.
Sourcepub fn require_one(&self) -> Result<(), QueryError>
pub fn require_one(&self) -> Result<(), QueryError>
Execute and require exactly one row.
Sourcepub fn require_some(&self) -> Result<(), QueryError>
pub fn require_some(&self) -> Result<(), QueryError>
Execute and require at least one row.
Sourcepub fn row(&self) -> Result<Row<E>, QueryError>
pub fn row(&self) -> Result<Row<E>, QueryError>
Execute and return the single row.
Sourcepub fn try_row(&self) -> Result<Option<Row<E>>, QueryError>
pub fn try_row(&self) -> Result<Option<Row<E>>, QueryError>
Execute and return zero or one row.
Sourcepub fn entity(&self) -> Result<E, QueryError>
pub fn entity(&self) -> Result<E, QueryError>
Execute and return the single entity.
Sourcepub fn try_entity(&self) -> Result<Option<E>, QueryError>
pub fn try_entity(&self) -> Result<Option<E>, QueryError>
Execute and return zero or one entity.
Sourcepub fn entities(&self) -> Result<Vec<E>, QueryError>
pub fn entities(&self) -> Result<Vec<E>, QueryError>
Execute and return all entities.
Sourcepub fn key(&self) -> Result<Option<Key>, QueryError>
pub fn key(&self) -> Result<Option<Key>, QueryError>
Execute and return the first store key, if any.
Sourcepub fn key_strict(&self) -> Result<Key, QueryError>
pub fn key_strict(&self) -> Result<Key, QueryError>
Execute and require exactly one store key.
Sourcepub fn try_key(&self) -> Result<Option<Key>, QueryError>
pub fn try_key(&self) -> Result<Option<Key>, QueryError>
Execute and return zero or one store key.
Sourcepub fn contains_key(&self, key: &Key) -> Result<bool, QueryError>
pub fn contains_key(&self, key: &Key) -> Result<bool, QueryError>
Execute and check whether the response contains the provided key.
Sourcepub fn primary_key(&self) -> Result<E::PrimaryKey, QueryError>
pub fn primary_key(&self) -> Result<E::PrimaryKey, QueryError>
Execute and require exactly one primary key.
Sourcepub fn try_primary_key(&self) -> Result<Option<E::PrimaryKey>, QueryError>
pub fn try_primary_key(&self) -> Result<Option<E::PrimaryKey>, QueryError>
Execute and return zero or one primary key.
Sourcepub fn primary_keys(&self) -> Result<Vec<E::PrimaryKey>, QueryError>
pub fn primary_keys(&self) -> Result<Vec<E::PrimaryKey>, QueryError>
Execute and return all primary keys.
Sourcepub fn view(&self) -> Result<View<E>, QueryError>
pub fn view(&self) -> Result<View<E>, QueryError>
Execute and return the single view.
Sourcepub fn view_opt(&self) -> Result<Option<View<E>>, QueryError>
pub fn view_opt(&self) -> Result<Option<View<E>>, QueryError>
Execute and return zero or one view.
Sourcepub fn delete_rows(&self) -> Result<Response<E>, QueryError>
pub fn delete_rows(&self) -> Result<Response<E>, QueryError>
Execute a delete query and return the deleted rows.