Type Alias sql_schema_describer::walkers::ForeignKeyWalker
source · pub type ForeignKeyWalker<'a> = Walker<'a, ForeignKeyId>;
Expand description
Traverse a foreign key.
Aliased Type§
struct ForeignKeyWalker<'a> {
pub id: ForeignKeyId,
pub schema: &'a SqlSchema,
}
Fields§
§id: ForeignKeyId
The identifier.
schema: &'a SqlSchema
The schema for which the identifier is valid.
Implementations§
source§impl<'schema> ForeignKeyWalker<'schema>
impl<'schema> ForeignKeyWalker<'schema>
sourcepub fn constrained_columns(
self
) -> impl ExactSizeIterator<Item = TableColumnWalker<'schema>>
pub fn constrained_columns( self ) -> impl ExactSizeIterator<Item = TableColumnWalker<'schema>>
The foreign key columns on the referencing table.
sourcepub fn constraint_name(self) -> Option<&'schema str>
pub fn constraint_name(self) -> Option<&'schema str>
The name of the foreign key constraint.
sourcepub fn on_delete_action(self) -> ForeignKeyAction
pub fn on_delete_action(self) -> ForeignKeyAction
The ON DELETE
behaviour of the foreign key.
sourcepub fn on_update_action(self) -> ForeignKeyAction
pub fn on_update_action(self) -> ForeignKeyAction
The ON UPDATE
behaviour of the foreign key.
sourcepub fn referenced_columns(
self
) -> impl ExactSizeIterator<Item = TableColumnWalker<'schema>>
pub fn referenced_columns( self ) -> impl ExactSizeIterator<Item = TableColumnWalker<'schema>>
The columns referenced by the foreign key on the referenced table.
sourcepub fn referenced_table_name(self) -> &'schema str
pub fn referenced_table_name(self) -> &'schema str
The table the foreign key “points to”.
sourcepub fn referenced_table(self) -> TableWalker<'schema>
pub fn referenced_table(self) -> TableWalker<'schema>
The table the foreign key “points to”.
sourcepub fn table(self) -> TableWalker<'schema>
pub fn table(self) -> TableWalker<'schema>
Traverse to the referencing/constrained table.
sourcepub fn is_self_relation(self) -> bool
pub fn is_self_relation(self) -> bool
True if relation is back to the same table.