pub struct ConstraintViolation {
pub name: Option<String>,
pub schema: Option<String>,
pub table: Option<String>,
pub column: Option<String>,
}Expand description
The constraint a database error names (#1531), as PostgreSQL reports it.
A unique index is reported under its index name (it has no pg_constraint row). The
table is the one PostgreSQL names: for a foreign-key violation that is the referencing
table in both directions, so the direction is not recoverable from it. A not-null
violation names no constraint, only its column; PostgreSQL 18 catalogues the not-null
constraint itself, so its name is resolvable from the column.
Fields§
§name: Option<String>The constraint’s (or unique index’s) name, when the error names one.
schema: Option<String>The schema of the table the error names.
table: Option<String>The table the error names.
column: Option<String>The column the error names (a not-null violation’s).
Trait Implementations§
Source§impl Clone for ConstraintViolation
impl Clone for ConstraintViolation
Source§impl Debug for ConstraintViolation
impl Debug for ConstraintViolation
impl Eq for ConstraintViolation
Source§impl PartialEq for ConstraintViolation
impl PartialEq for ConstraintViolation
impl StructuralPartialEq for ConstraintViolation
Auto Trait Implementations§
impl Freeze for ConstraintViolation
impl RefUnwindSafe for ConstraintViolation
impl Send for ConstraintViolation
impl Sync for ConstraintViolation
impl Unpin for ConstraintViolation
impl UnsafeUnpin for ConstraintViolation
impl UnwindSafe for ConstraintViolation
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.