pub type LinkDef = RelationDef;Expand description
One hop in a multi-hop Linked chain. Alias for RelationDef.
Aliased Type§
pub struct LinkDef {
pub rel_type: RelationType,
pub from_tbl: TableRef,
pub to_tbl: TableRef,
pub from_col: Identity,
pub to_col: Identity,
pub is_owner: bool,
pub skip_fk: bool,
pub on_delete: Option<ForeignKeyAction>,
pub on_update: Option<ForeignKeyAction>,
pub on_condition: Option<Arc<dyn Fn(DynIden, DynIden) -> Condition>>,
pub fk_name: Option<String>,
pub condition_type: ConditionType,
}Fields§
§rel_type: RelationTypeCardinality of the relation.
from_tbl: TableRefTable at the FK-owning end of the relation.
to_tbl: TableRefTable being pointed to by the foreign key.
from_col: IdentityFK column(s) on from_tbl.
to_col: IdentityReferenced column(s) on to_tbl (usually the primary key).
is_owner: booltrue if Self is the FK-owning side (i.e. holds from_col).
skip_fk: boolSkip emitting a FOREIGN KEY constraint when this relation is used
to generate schema DDL.
on_delete: Option<ForeignKeyAction>ON DELETE action for the foreign key.
on_update: Option<ForeignKeyAction>ON UPDATE action for the foreign key.
on_condition: Option<Arc<dyn Fn(DynIden, DynIden) -> Condition>>Extra predicate to AND/OR into the join’s ON clause; see
RelationDef::on_condition.
fk_name: Option<String>Name of the foreign-key constraint to emit in DDL.
condition_type: ConditionTypeHow on_condition is combined with the
column equality predicate (All = AND, Any = OR).