pub struct UpdateManyOperation<E: QueryEngine, M: Model> { /* private fields */ }Expand description
Update many records at once.
Implementations§
Source§impl<E: QueryEngine, M: Model> UpdateManyOperation<E, M>
impl<E: QueryEngine, M: Model> UpdateManyOperation<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_op(self, column: impl Into<String>, op: WriteOp) -> Self
pub fn set_op(self, column: impl Into<String>, op: WriteOp) -> Self
Apply a column-keyed WriteOp.
Sourcepub fn with_where_input<W: WhereInput<Model = M>>(self, w: W) -> Self
pub fn with_where_input<W: WhereInput<Model = M>>(self, w: W) -> Self
Apply a typed WhereInput. AND-composes with the existing filter.
Sourcepub fn with_update_input<I>(self, input: I) -> Selfwhere
I: UpdateInput<Model = M, Data = UpdatePayload>,
pub fn with_update_input<I>(self, input: I) -> Selfwhere
I: UpdateInput<Model = M, Data = UpdatePayload>,
Apply a typed UpdateInput.
See UpdateOperation::with_update_input for the lowering
semantics — the only difference here is that update_many does
not return rows.
Sourcepub fn build_sql(&self, dialect: &dyn SqlDialect) -> (String, Vec<FilterValue>)
pub fn build_sql(&self, dialect: &dyn SqlDialect) -> (String, Vec<FilterValue>)
Build the SQL query.
Sourcepub async fn exec(self) -> QueryResult<u64>
pub async fn exec(self) -> QueryResult<u64>
Execute the update and return the count of modified records.
Auto Trait Implementations§
impl<E, M> Freeze for UpdateManyOperation<E, M>where
E: Freeze,
impl<E, M> RefUnwindSafe for UpdateManyOperation<E, M>where
E: RefUnwindSafe,
M: RefUnwindSafe,
impl<E, M> Send for UpdateManyOperation<E, M>
impl<E, M> Sync for UpdateManyOperation<E, M>
impl<E, M> Unpin for UpdateManyOperation<E, M>
impl<E, M> UnsafeUnpin for UpdateManyOperation<E, M>where
E: UnsafeUnpin,
impl<E, M> UnwindSafe for UpdateManyOperation<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