pub struct UpdateStatement { /* private fields */ }Expand description
Implementations§
Source§impl UpdateStatement
impl UpdateStatement
Sourcepub fn take(&mut self) -> Self
pub fn take(&mut self) -> Self
Take the ownership of data in the current UpdateStatement
Sourcepub fn table<T>(&mut self, tbl: T) -> &mut Selfwhere
T: IntoTableRef,
pub fn table<T>(&mut self, tbl: T) -> &mut Selfwhere
T: IntoTableRef,
Sourcepub fn value_expr<C, E>(&mut self, col: C, expr: E) -> &mut Self
pub fn value_expr<C, E>(&mut self, col: C, expr: E) -> &mut Self
Set a column to an expression value
Use this method when the value is an expression (e.g., Expr::current_timestamp(),
Expr::col("other_column"), Expr::cust("NULL")) rather than a plain value.
§Examples
ⓘ
use reinhardt_query::prelude::*;
let query = Query::update()
.table("users")
.value_expr("updated_at", Expr::current_timestamp())
.value_expr("status", Expr::cust("NULL"));Sourcepub fn and_where<C>(&mut self, condition: C) -> &mut Selfwhere
C: IntoCondition,
pub fn and_where<C>(&mut self, condition: C) -> &mut Selfwhere
C: IntoCondition,
Sourcepub fn cond_where(&mut self, condition: Condition) -> &mut Self
pub fn cond_where(&mut self, condition: Condition) -> &mut Self
Sourcepub fn returning<I, C>(&mut self, cols: I) -> &mut Selfwhere
I: IntoIterator<Item = C>,
C: IntoColumnRef,
pub fn returning<I, C>(&mut self, cols: I) -> &mut Selfwhere
I: IntoIterator<Item = C>,
C: IntoColumnRef,
Sourcepub fn returning_all(&mut self) -> &mut Self
pub fn returning_all(&mut self) -> &mut Self
Trait Implementations§
Source§impl Clone for UpdateStatement
impl Clone for UpdateStatement
Source§fn clone(&self) -> UpdateStatement
fn clone(&self) -> UpdateStatement
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UpdateStatement
impl Debug for UpdateStatement
Source§impl Default for UpdateStatement
impl Default for UpdateStatement
Source§impl QueryStatementBuilder for UpdateStatement
impl QueryStatementBuilder for UpdateStatement
Source§fn build_any(&self, query_builder: &dyn QueryBuilderTrait) -> (String, Values)
fn build_any(&self, query_builder: &dyn QueryBuilderTrait) -> (String, Values)
Build SQL statement for a database backend and collect query parameters Read more
impl QueryStatementWriter for UpdateStatement
Auto Trait Implementations§
impl Freeze for UpdateStatement
impl !RefUnwindSafe for UpdateStatement
impl !Send for UpdateStatement
impl !Sync for UpdateStatement
impl Unpin for UpdateStatement
impl UnsafeUnpin for UpdateStatement
impl !UnwindSafe for UpdateStatement
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