pub type RelationField = Zipper<RelationFieldId>;

Aliased Type§

struct RelationField {
    pub id: RelationFieldId,
    pub dm: InternalDataModel,
}

Fields§

§id: RelationFieldId§dm: InternalDataModel

Implementations§

source§

impl RelationField

source

pub fn borrowed_name<'a>(&self, schema: &'a ValidatedSchema) -> &'a str

source

pub fn name(&self) -> &str

source

pub fn arity(&self) -> FieldArity

source

pub fn is_list(&self) -> bool

source

pub fn is_required(&self) -> bool

source

pub fn linking_fields(&self) -> FieldSelection

Returns the FieldSelection used for this relation fields model.

What is the field selection of a relation field?

The set of fields required by the relation (on the model of the relation field) to be able to link the related records.

In case of a many-to-many relation field, we can make the assumption that the primary identifier of the enclosing model is the set of linking fields, as this is how Prisma many-to-many works and we only support implicit join tables (i.e. m:n) in the Prisma style.

source

pub fn is_optional(&self) -> bool

source

pub fn model(&self) -> Model

source

pub fn scalar_fields(&self) -> Vec<ScalarFieldRef>

source

pub fn relation(&self) -> Relation

source

pub fn is_inlined_on_enclosing_model(&self) -> bool

Alias for more clarity (in most cases, doesn’t add more clarity for self-relations);

source

pub fn relation_is_inlined_in_parent(&self) -> bool

Inlined in self / model of self

source

pub fn relation_is_inlined_in_child(&self) -> bool

source

pub fn related_model(&self) -> Model

source

pub fn related_field(&self) -> RelationField

source

pub fn type_identifiers_with_arities(&self) -> Vec<(TypeIdentifier, FieldArity)>

source

pub fn referenced_fields(&self) -> Vec<ScalarFieldRef>

source

pub fn left_scalars(&self) -> Vec<ScalarFieldRef>

source

pub fn db_names(&self) -> impl Iterator<Item = String>

Trait Implementations§

source§

impl Debug for RelationField

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for RelationField

source§

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

Formats the value using the given formatter. Read more
source§

impl RelationCompare for RelationField

Every related record matches the filter.

At least one related record matches the filter.

To one related record. FIXME

None of the related records matches the filter.

source§

fn one_relation_is_null(&self) -> Filter

One of the relations is Null.