Skip to main content

LinkDef

Type Alias LinkDef 

Source
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: RelationType

Cardinality of the relation.

§from_tbl: TableRef

Table at the FK-owning end of the relation.

§to_tbl: TableRef

Table being pointed to by the foreign key.

§from_col: Identity

FK column(s) on from_tbl.

§to_col: Identity

Referenced column(s) on to_tbl (usually the primary key).

§is_owner: bool

true if Self is the FK-owning side (i.e. holds from_col).

§skip_fk: bool

Skip 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: ConditionType

How on_condition is combined with the column equality predicate (All = AND, Any = OR).