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>

source

pub fn constrained_columns( self ) -> impl ExactSizeIterator<Item = TableColumnWalker<'schema>>

The foreign key columns on the referencing table.

source

pub fn constraint_name(self) -> Option<&'schema str>

The name of the foreign key constraint.

source

pub fn on_delete_action(self) -> ForeignKeyAction

The ON DELETE behaviour of the foreign key.

source

pub fn on_update_action(self) -> ForeignKeyAction

The ON UPDATE behaviour of the foreign key.

source

pub fn referenced_columns( self ) -> impl ExactSizeIterator<Item = TableColumnWalker<'schema>>

The columns referenced by the foreign key on the referenced table.

source

pub fn referenced_table_name(self) -> &'schema str

The table the foreign key “points to”.

source

pub fn referenced_table(self) -> TableWalker<'schema>

The table the foreign key “points to”.

source

pub fn table(self) -> TableWalker<'schema>

Traverse to the referencing/constrained table.

source

pub fn is_self_relation(self) -> bool

True if relation is back to the same table.