ForeignKeyConstraint in sqlparser::ast::table_constraints - Rust

Struct ForeignKeyConstraint 

Source

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>] }).

Optional constraint name.

§columns: Vec<Ident>

Columns in the local table that participate in the foreign key.

Referenced foreign table name.

§referred_columns: Vec<Ident>

Columns in the referenced table.

Action to perform ON DELETE.

Action to perform ON UPDATE.

Optional MATCH kind (FULL | PARTIAL | SIMPLE).

Optional characteristics (e.g., DEFERRABLE).

§
§
§
§
§
§