pub struct ForeignKeyConstraint {
pub name: Option<Ident>,
pub index_name: Option<Ident>,
pub columns: Vec<Ident>,
pub foreign_table: ObjectName,
pub referred_columns: Vec<Ident>,
pub on_delete: Option<ReferentialAction>,
pub on_update: Option<ReferentialAction>,
pub match_kind: Option<ConstraintReferenceMatchKind>,
pub characteristics: Option<ConstraintCharacteristics>,
}Expand description
A referential integrity constraint ([ CONSTRAINT <name> ] FOREIGN KEY (<columns>) REFERENCES <foreign_table> (<referred_columns>) [ MATCH { FULL | PARTIAL | SIMPLE } ] { [ON DELETE <referential_action>] [ON UPDATE <referential_action>] | [ON UPDATE <referential_action>] [ON DELETE <referential_action>] }).
Fields§
§name: Option<Ident>Optional constraint name.
index_name: Option<Ident>MySQL-specific index name associated with the foreign key. https://dev.mysql.com/doc/refman/8.4/en/create-table-foreign-keys.html
columns: Vec<Ident>Columns in the local table that participate in the foreign key.
foreign_table: ObjectNameReferenced foreign table name.
referred_columns: Vec<Ident>Columns in the referenced table.
on_delete: Option<ReferentialAction>Action to perform ON DELETE.
on_update: Option<ReferentialAction>Action to perform ON UPDATE.
match_kind: Option<ConstraintReferenceMatchKind>Optional MATCH kind (FULL | PARTIAL | SIMPLE).
characteristics: Option<ConstraintCharacteristics>Optional characteristics (e.g., DEFERRABLE).
Trait Implementations§
Source§impl Clone for ForeignKeyConstraint
impl Clone for ForeignKeyConstraint
Source§fn clone(&self) -> ForeignKeyConstraint
fn clone(&self) -> ForeignKeyConstraint
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 ForeignKeyConstraint
impl Debug for ForeignKeyConstraint
Source§impl Display for ForeignKeyConstraint
impl Display for ForeignKeyConstraint
Source§impl From<ForeignKeyConstraint> for ColumnOption
impl From<ForeignKeyConstraint> for ColumnOption
Source§fn from(fk: ForeignKeyConstraint) -> Self
fn from(fk: ForeignKeyConstraint) -> Self
Converts to this type from the input type.
Source§impl From<ForeignKeyConstraint> for TableConstraint
impl From<ForeignKeyConstraint> for TableConstraint
Source§fn from(constraint: ForeignKeyConstraint) -> Self
fn from(constraint: ForeignKeyConstraint) -> Self
Converts to this type from the input type.
Source§impl Hash for ForeignKeyConstraint
impl Hash for ForeignKeyConstraint
Source§impl Ord for ForeignKeyConstraint
impl Ord for ForeignKeyConstraint
Source§fn cmp(&self, other: &ForeignKeyConstraint) -> Ordering
fn cmp(&self, other: &ForeignKeyConstraint) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ForeignKeyConstraint
impl PartialEq for ForeignKeyConstraint
Source§impl PartialOrd for ForeignKeyConstraint
impl PartialOrd for ForeignKeyConstraint
Source§impl Spanned for ForeignKeyConstraint
impl Spanned for ForeignKeyConstraint
Source§impl Visit for ForeignKeyConstraint
impl Visit for ForeignKeyConstraint
Source§impl VisitMut for ForeignKeyConstraint
impl VisitMut for ForeignKeyConstraint
Source§fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
Mutably visit this node with the provided
VisitorMut. Read moreimpl Eq for ForeignKeyConstraint
impl StructuralPartialEq for ForeignKeyConstraint
Auto Trait Implementations§
impl Freeze for ForeignKeyConstraint
impl RefUnwindSafe for ForeignKeyConstraint
impl Send for ForeignKeyConstraint
impl Sync for ForeignKeyConstraint
impl Unpin for ForeignKeyConstraint
impl UnsafeUnpin for ForeignKeyConstraint
impl UnwindSafe for ForeignKeyConstraint
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