pub enum ConflictTarget<'a> {
Columns(SQL<'a, PostgresValue<'a>>),
ColumnsWhere {
columns: SQL<'a, PostgresValue<'a>>,
where_clause: SQL<'a, PostgresValue<'a>>,
},
Constraint(String),
}Expand description
Conflict target specification for PostgreSQL ON CONFLICT clause
Variants§
Columns(SQL<'a, PostgresValue<'a>>)
Target specific columns: ON CONFLICT (column1, column2, …)
ColumnsWhere
Target specific columns with WHERE clause for partial unique indexes ON CONFLICT (column1, column2, …) WHERE condition
Constraint(String)
Target a specific constraint by name: ON CONFLICT ON CONSTRAINT constraint_name
Implementations§
Source§impl<'a> ConflictTarget<'a>
impl<'a> ConflictTarget<'a>
Sourcepub fn columns<T>(columns: T) -> Selfwhere
T: ToSQL<'a, PostgresValue<'a>>,
pub fn columns<T>(columns: T) -> Selfwhere
T: ToSQL<'a, PostgresValue<'a>>,
Create a column target
Sourcepub fn columns_where<T, W>(columns: T, where_clause: W) -> Self
pub fn columns_where<T, W>(columns: T, where_clause: W) -> Self
Create a column target with WHERE clause for partial unique indexes
Sourcepub fn constraint(constraint_name: String) -> Self
pub fn constraint(constraint_name: String) -> Self
Create a constraint target
Trait Implementations§
Source§impl<'a> Clone for ConflictTarget<'a>
impl<'a> Clone for ConflictTarget<'a>
Source§fn clone(&self) -> ConflictTarget<'a>
fn clone(&self) -> ConflictTarget<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for ConflictTarget<'a>
impl<'a> !RefUnwindSafe for ConflictTarget<'a>
impl<'a> Send for ConflictTarget<'a>
impl<'a> Sync for ConflictTarget<'a>
impl<'a> Unpin for ConflictTarget<'a>
impl<'a> !UnwindSafe for ConflictTarget<'a>
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