Type Alias query_structure::prelude::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

source

pub fn name(&self) -> String

source

pub fn is_inline_relation(&self) -> bool

Returns true only if the Relation is just a link between two RelationFields.

source

pub fn is_relation_table(&self) -> bool

Returns true if the Relation is a table linking two models.

source

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.

source

pub fn is_many_to_many(&self) -> bool

Practically deprecated with Prisma 2.

source

pub fn is_one_to_one(&self) -> bool

source

pub fn is_one_to_many(&self) -> bool

source

pub fn on_delete(&self) -> ReferentialAction

Retrieves the onDelete policy for this relation.

source

pub fn on_update(&self) -> ReferentialAction

Retrieves the onUpdate policy for this relation.

Trait Implementations§

source§

impl Debug for Relation

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more