pub struct ConflictTarget {
pub constraint: Option<Cow<'static, str>>,
pub columns: Vec<Expr>,
pub where_: Where,
}Expand description
What the conflict is detected on: a named constraint, or an index inferred from a column list and an optional predicate.
A constraint name wins outright, because PostgreSQL forbids combining the two —
ON CONSTRAINT names an index directly and leaves nothing to infer.
Fields§
§constraint: Option<Cow<'static, str>>ON CONSTRAINT <name>. Quoted on output.
columns: Vec<Expr>The columns or expressions the unique index is over.
where_: WhereThe partial index’s predicate — matched against the index definition, not evaluated against rows.
Implementations§
Source§impl ConflictTarget
impl ConflictTarget
Sourcepub fn on_columns(columns: impl IntoExprList) -> Self
pub fn on_columns(columns: impl IntoExprList) -> Self
Infer the index from columns.
Sourcepub fn on_constraint(name: impl Into<Cow<'static, str>>) -> Self
pub fn on_constraint(name: impl Into<Cow<'static, str>>) -> Self
Name the constraint directly.
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 (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 ConflictTarget
impl Debug for ConflictTarget
Source§impl Default for ConflictTarget
impl Default for ConflictTarget
Source§fn default() -> ConflictTarget
fn default() -> ConflictTarget
Returns the “default value” for a type. Read more
Source§impl Expression for ConflictTarget
impl Expression for ConflictTarget
Auto Trait Implementations§
impl !RefUnwindSafe for ConflictTarget
impl !UnwindSafe for ConflictTarget
impl Freeze for ConflictTarget
impl Send for ConflictTarget
impl Sync for ConflictTarget
impl Unpin for ConflictTarget
impl UnsafeUnpin 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