Type Alias query_structure::Relation
source · pub type Relation = Zipper<RelationId>;
Aliased Type§
struct Relation {
pub id: RelationId,
pub dm: InternalDataModel,
}
Fields§
§id: RelationId
§dm: InternalDataModel
Implementations§
source§impl Relation
impl Relation
pub fn name(&self) -> String
sourcepub fn is_inline_relation(&self) -> bool
pub fn is_inline_relation(&self) -> bool
Returns true
only if the Relation
is just a link between two
RelationField
s.
sourcepub fn is_relation_table(&self) -> bool
pub fn is_relation_table(&self) -> bool
Returns true
if the Relation
is a table linking two models.
sourcepub fn is_self_relation(&self) -> bool
pub fn is_self_relation(&self) -> bool
A model that relates to itself. For example a Person
that is a parent
can relate to people that are children.
sourcepub fn is_many_to_many(&self) -> bool
pub fn is_many_to_many(&self) -> bool
Practically deprecated with Prisma 2.
pub fn is_one_to_one(&self) -> bool
pub fn is_one_to_many(&self) -> bool
sourcepub fn on_delete(&self) -> ReferentialAction
pub fn on_delete(&self) -> ReferentialAction
Retrieves the onDelete policy for this relation.
sourcepub fn on_update(&self) -> ReferentialAction
pub fn on_update(&self) -> ReferentialAction
Retrieves the onUpdate policy for this relation.