pub struct UpdateOperation<E: QueryEngine, M: Model> { /* private fields */ }Expand description
Implementations§
Source§impl<E: QueryEngine, M: Model> UpdateOperation<E, M>
impl<E: QueryEngine, M: Model> UpdateOperation<E, M>
Sourcepub fn set(
self,
column: impl Into<String>,
value: impl Into<FilterValue>,
) -> Self
pub fn set( self, column: impl Into<String>, value: impl Into<FilterValue>, ) -> Self
Set a column to a new value.
Sourcepub fn set_many(
self,
values: impl IntoIterator<Item = (impl Into<String>, impl Into<FilterValue>)>,
) -> Self
pub fn set_many( self, values: impl IntoIterator<Item = (impl Into<String>, impl Into<FilterValue>)>, ) -> Self
Set multiple columns from an iterator.
Sourcepub fn increment(self, column: impl Into<String>, amount: i64) -> Self
pub fn increment(self, column: impl Into<String>, amount: i64) -> Self
Increment a numeric column.
Sourcepub fn build_sql(&self) -> (String, Vec<FilterValue>)
pub fn build_sql(&self) -> (String, Vec<FilterValue>)
Build the SQL query.
Sourcepub async fn exec(self) -> QueryResult<Vec<M>>where
M: Send + 'static,
pub async fn exec(self) -> QueryResult<Vec<M>>where
M: Send + 'static,
Execute the update and return modified records.
Sourcepub async fn exec_one(self) -> QueryResult<M>where
M: Send + 'static,
pub async fn exec_one(self) -> QueryResult<M>where
M: Send + 'static,
Execute the update and return the first modified record.
Auto Trait Implementations§
impl<E, M> Freeze for UpdateOperation<E, M>where
E: Freeze,
impl<E, M> RefUnwindSafe for UpdateOperation<E, M>where
E: RefUnwindSafe,
M: RefUnwindSafe,
impl<E, M> Send for UpdateOperation<E, M>
impl<E, M> Sync for UpdateOperation<E, M>
impl<E, M> Unpin for UpdateOperation<E, M>
impl<E, M> UnwindSafe for UpdateOperation<E, M>where
E: UnwindSafe,
M: UnwindSafe,
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