pub enum ConflictTarget {
Columns(Vec<String>),
Constraint(String),
IndexExpression(String),
Implicit,
}Expand description
What to match on for conflict detection.
Variants§
Columns(Vec<String>)
Match on specific columns (unique constraint).
Constraint(String)
Match on a named constraint.
IndexExpression(String)
Match on index expression (PostgreSQL).
Implicit
No specific target (MySQL ON DUPLICATE KEY).
Implementations§
Source§impl ConflictTarget
impl ConflictTarget
Sourcepub fn constraint(name: impl Into<String>) -> Self
pub fn constraint(name: impl Into<String>) -> Self
Create a constraint-based conflict target.
Sourcepub fn index_expression(expr: impl Into<String>) -> Self
pub fn index_expression(expr: impl Into<String>) -> Self
Create an index expression conflict target.
Sourcepub fn to_postgres_sql(&self) -> String
pub fn to_postgres_sql(&self) -> String
Generate PostgreSQL ON CONFLICT target.
Sourcepub fn to_sqlite_sql(&self) -> String
pub fn to_sqlite_sql(&self) -> String
Generate SQLite ON CONFLICT target.
Trait Implementations§
Source§impl Clone for ConflictTarget
impl Clone for ConflictTarget
Source§fn clone(&self) -> ConflictTarget
fn clone(&self) -> ConflictTarget
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 moreSource§impl Debug for ConflictTarget
impl Debug for ConflictTarget
Source§impl<'de> Deserialize<'de> for ConflictTarget
impl<'de> Deserialize<'de> for ConflictTarget
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ConflictTarget
impl PartialEq for ConflictTarget
Source§impl Serialize for ConflictTarget
impl Serialize for ConflictTarget
impl Eq for ConflictTarget
impl StructuralPartialEq for ConflictTarget
Auto Trait Implementations§
impl Freeze for ConflictTarget
impl RefUnwindSafe for ConflictTarget
impl Send for ConflictTarget
impl Sync for ConflictTarget
impl Unpin for ConflictTarget
impl UnwindSafe for ConflictTarget
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