pub struct UpsertBuilder<M = ()> { /* private fields */ }Expand description
Builder for UPSERT operations (INSERT … ON CONFLICT UPDATE)
Implementations§
Source§impl<M> UpsertBuilder<M>
impl<M> UpsertBuilder<M>
Sourcepub fn update_set<T: Into<Value>>(self, column: &str, value: T) -> Self
pub fn update_set<T: Into<Value>>(self, column: &str, value: T) -> Self
Add an update clause for conflict resolution
Sourcepub fn update_set_null(self, column: &str) -> Self
pub fn update_set_null(self, column: &str) -> Self
Add a NULL update clause for conflict resolution
Sourcepub fn build(self) -> QueryBuilder<M>
pub fn build(self) -> QueryBuilder<M>
Finish building the upsert query
Sourcepub fn to_sql_with_params(&self) -> (String, Vec<String>)
pub fn to_sql_with_params(&self) -> (String, Vec<String>)
Generate SQL for the upsert operation
Trait Implementations§
Auto Trait Implementations§
impl<M> Freeze for UpsertBuilder<M>
impl<M> RefUnwindSafe for UpsertBuilder<M>where
M: RefUnwindSafe,
impl<M> Send for UpsertBuilder<M>where
M: Send,
impl<M> Sync for UpsertBuilder<M>where
M: Sync,
impl<M> Unpin for UpsertBuilder<M>where
M: Unpin,
impl<M> UnwindSafe for UpsertBuilder<M>where
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more