Type Alias query_structure::prelude::RelationField
source · pub type RelationField = Zipper<RelationFieldId>;
Aliased Type§
struct RelationField {
pub id: RelationFieldId,
pub dm: InternalDataModel,
}
Fields§
§id: RelationFieldId
§dm: InternalDataModel
Implementations§
source§impl RelationField
impl RelationField
pub fn borrowed_name<'a>(&self, schema: &'a ValidatedSchema) -> &'a str
pub fn name(&self) -> &str
pub fn arity(&self) -> FieldArity
pub fn is_list(&self) -> bool
pub fn is_required(&self) -> bool
sourcepub fn linking_fields(&self) -> FieldSelection
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.
pub fn is_optional(&self) -> bool
pub fn model(&self) -> Model
pub fn scalar_fields(&self) -> Vec<ScalarFieldRef>
pub fn relation(&self) -> Relation
sourcepub fn is_inlined_on_enclosing_model(&self) -> bool
pub fn is_inlined_on_enclosing_model(&self) -> bool
Alias for more clarity (in most cases, doesn’t add more clarity for self-relations);
sourcepub fn relation_is_inlined_in_parent(&self) -> bool
pub fn relation_is_inlined_in_parent(&self) -> bool
Inlined in self / model of self
pub fn relation_is_inlined_in_child(&self) -> bool
pub fn type_identifiers_with_arities(&self) -> Vec<(TypeIdentifier, FieldArity)>
pub fn referenced_fields(&self) -> Vec<ScalarFieldRef>
pub fn left_scalars(&self) -> Vec<ScalarFieldRef>
pub fn db_names(&self) -> impl Iterator<Item = String>
Trait Implementations§
source§impl Debug for RelationField
impl Debug for RelationField
source§impl Display for RelationField
impl Display for RelationField
source§impl RelationCompare for RelationField
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
fn one_relation_is_null(&self) -> Filter
One of the relations is Null
.