pub struct DeleteExecutor<E: EntityKind> { /* private fields */ }Expand description
DeleteExecutor
Implementations§
Source§impl<E: EntityKind> DeleteExecutor<E>
impl<E: EntityKind> DeleteExecutor<E>
pub const fn new(db: Db<E::Canister>, debug: bool) -> Self
pub const fn debug(self) -> Self
Sourcepub fn one(self, pk: impl FieldValue) -> Result<Response<E>, Error>
pub fn one(self, pk: impl FieldValue) -> Result<Response<E>, Error>
Delete a single row by primary key.
Sourcepub fn many<I, V>(self, values: I) -> Result<Response<E>, Error>where
I: IntoIterator<Item = V>,
V: FieldValue,
pub fn many<I, V>(self, values: I) -> Result<Response<E>, Error>where
I: IntoIterator<Item = V>,
V: FieldValue,
Delete multiple rows by primary keys.
Sourcepub fn by_unique_index(
self,
index: UniqueIndexHandle,
entity: E,
) -> Result<Response<E>, Error>where
E::PrimaryKey: FromKey,
pub fn by_unique_index(
self,
index: UniqueIndexHandle,
entity: E,
) -> Result<Response<E>, Error>where
E::PrimaryKey: FromKey,
Delete a single row using a unique index handle.
Sourcepub fn one_by_field(
self,
field: impl AsRef<str>,
value: impl FieldValue,
) -> Result<Response<E>, Error>
pub fn one_by_field( self, field: impl AsRef<str>, value: impl FieldValue, ) -> Result<Response<E>, Error>
Delete a single row by an arbitrary field value.
Sourcepub fn many_by_field<I, V>(
self,
field: impl AsRef<str>,
values: I,
) -> Result<Response<E>, Error>where
I: IntoIterator<Item = V>,
V: FieldValue,
pub fn many_by_field<I, V>(
self,
field: impl AsRef<str>,
values: I,
) -> Result<Response<E>, Error>where
I: IntoIterator<Item = V>,
V: FieldValue,
Delete multiple rows by an arbitrary field.
Sourcepub fn filter<F, I>(self, f: F) -> Result<Response<E>, Error>
pub fn filter<F, I>(self, f: F) -> Result<Response<E>, Error>
Apply a filter builder and delete matches.
pub fn ensure_delete_one(self, pk: impl FieldValue) -> Result<(), Error>
pub fn ensure_delete_any_by_pk<I, V>(self, pks: I) -> Result<(), Error>where
I: IntoIterator<Item = V>,
V: FieldValue,
pub fn ensure_delete_any<I, V>(self, values: I) -> Result<(), Error>where
I: IntoIterator<Item = V>,
V: FieldValue,
pub fn explain(self, query: DeleteQuery) -> Result<QueryPlan, Error>
Trait Implementations§
Source§impl<E: Clone + EntityKind> Clone for DeleteExecutor<E>
impl<E: Clone + EntityKind> Clone for DeleteExecutor<E>
Source§fn clone(&self) -> DeleteExecutor<E>
fn clone(&self) -> DeleteExecutor<E>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<E: Copy + EntityKind> Copy for DeleteExecutor<E>
Auto Trait Implementations§
impl<E> Freeze for DeleteExecutor<E>
impl<E> RefUnwindSafe for DeleteExecutor<E>
impl<E> Send for DeleteExecutor<E>
impl<E> Sync for DeleteExecutor<E>
impl<E> Unpin for DeleteExecutor<E>
impl<E> UnwindSafe for DeleteExecutor<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