#[non_exhaustive]pub enum TableConstraint {
PrimaryKey {
name: Option<DynIden>,
columns: Vec<DynIden>,
},
Unique {
name: Option<DynIden>,
columns: Vec<DynIden>,
},
ForeignKey {
name: Option<DynIden>,
columns: Vec<DynIden>,
ref_table: Box<TableRef>,
ref_columns: Vec<DynIden>,
on_delete: Option<ForeignKeyAction>,
on_update: Option<ForeignKeyAction>,
},
Check {
name: Option<DynIden>,
expr: SimpleExpr,
},
}Expand description
Table constraint
This enum represents various table-level constraints.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PrimaryKey
PRIMARY KEY constraint
Unique
UNIQUE constraint
ForeignKey
FOREIGN KEY constraint
Fields
§
on_delete: Option<ForeignKeyAction>ON DELETE action
§
on_update: Option<ForeignKeyAction>ON UPDATE action
Check
CHECK constraint
Trait Implementations§
Source§impl Clone for TableConstraint
impl Clone for TableConstraint
Source§fn clone(&self) -> TableConstraint
fn clone(&self) -> TableConstraint
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 Freeze for TableConstraint
impl !RefUnwindSafe for TableConstraint
impl !Send for TableConstraint
impl !Sync for TableConstraint
impl Unpin for TableConstraint
impl UnsafeUnpin for TableConstraint
impl !UnwindSafe for TableConstraint
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