sea_orm::entity

Type Alias LinkDef

Source
pub type LinkDef = RelationDef;
Expand description

Same as RelationDef

Aliased Typeยง

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 on_delete: Option<ForeignKeyAction>,
    pub on_update: Option<ForeignKeyAction>,
    pub on_condition: Option<Box<dyn Fn(SeaRc<dyn Iden>, SeaRc<dyn Iden>) -> Condition + Sync + Send>>,
    pub fk_name: Option<String>,
    pub condition_type: ConditionType,
}

Fieldsยง

ยงrel_type: RelationType

The type of relationship defined in RelationType

ยงfrom_tbl: TableRef

Reference from another Entity

ยงto_tbl: TableRef

Reference to another ENtity

ยงfrom_col: Identity

Reference to from a Column

ยงto_col: Identity

Reference to another column

ยงis_owner: bool

Defines the owner of the Relation

ยงon_delete: Option<ForeignKeyAction>

Defines an operation to be performed on a Foreign Key when a DELETE Operation is performed

ยงon_update: Option<ForeignKeyAction>

Defines an operation to be performed on a Foreign Key when a UPDATE Operation is performed

ยงon_condition: Option<Box<dyn Fn(SeaRc<dyn Iden>, SeaRc<dyn Iden>) -> Condition + Sync + Send>>

Custom join ON condition

ยงfk_name: Option<String>

The name of foreign key constraint

ยงcondition_type: ConditionType

Condition type of join on expression