Skip to main content

UpdateDyn

Struct UpdateDyn 

Source
pub struct UpdateDyn<Table, Set> { /* private fields */ }
Expand description

A dynamic UPDATE statement builder using string-based column names.

For compile-time validated queries, use Update from builder::typed.

Implementations§

Source§

impl UpdateDyn<NoTable, NoSet>

Source

pub fn new() -> Self

Creates a new UPDATE builder.

Source§

impl<Set> UpdateDyn<NoTable, Set>

Source

pub fn table(self, table: &str) -> UpdateDyn<HasTable, Set>

Specifies the table to update.

Source§

impl UpdateDyn<HasTable, NoSet>

Source

pub fn set<T: ToSqlValue>( self, column: &str, value: T, ) -> UpdateDyn<HasTable, HasSet>

Adds a SET assignment.

Source§

impl UpdateDyn<HasTable, HasSet>

Source

pub fn set<T: ToSqlValue>(self, column: &str, value: T) -> Self

Adds another SET assignment.

Source

pub fn where_clause(self, expr: ExprBuilder) -> Self

Adds a WHERE clause.

Source

pub fn build(self) -> (String, Vec<SqlValue>)

Builds the UPDATE statement and returns SQL with parameters.

Source

pub fn build_sql(self) -> String

Builds the UPDATE statement and returns only the SQL string.

Trait Implementations§

Source§

impl Default for UpdateDyn<NoTable, NoSet>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<Table, Set> Freeze for UpdateDyn<Table, Set>

§

impl<Table, Set> RefUnwindSafe for UpdateDyn<Table, Set>
where Table: RefUnwindSafe, Set: RefUnwindSafe,

§

impl<Table, Set> Send for UpdateDyn<Table, Set>
where Table: Send, Set: Send,

§

impl<Table, Set> Sync for UpdateDyn<Table, Set>
where Table: Sync, Set: Sync,

§

impl<Table, Set> Unpin for UpdateDyn<Table, Set>
where Table: Unpin, Set: Unpin,

§

impl<Table, Set> UnwindSafe for UpdateDyn<Table, Set>
where Table: UnwindSafe, Set: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.