Struct query_structure::Zipper
source · pub struct Zipper<I> {
pub id: I,
pub dm: InternalDataModel,
}
Fields§
§id: I
§dm: InternalDataModel
Implementations§
source§impl Zipper<CompositeTypeId>
impl Zipper<CompositeTypeId>
source§impl Zipper<CompositeFieldId>
impl Zipper<CompositeFieldId>
pub fn borrowed_name<'a>(&self, schema: &'a ValidatedSchema) -> &'a str
pub fn arity(&self) -> FieldArity
pub fn typ(&self) -> CompositeType
pub fn is_list(&self) -> bool
pub fn is_required(&self) -> bool
pub fn is_optional(&self) -> bool
pub fn name(&self) -> &str
pub fn db_name(&self) -> &str
pub fn container(&self) -> ParentContainer
source§impl Zipper<RelationFieldId>
impl Zipper<RelationFieldId>
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>
source§impl Zipper<ScalarFieldId>
impl Zipper<ScalarFieldId>
pub fn is_id(&self) -> bool
pub fn is_list(&self) -> bool
pub fn is_required(&self) -> bool
pub fn unique(&self) -> bool
pub fn db_name(&self) -> &str
pub fn type_identifier_with_arity(&self) -> (TypeIdentifier, FieldArity)
pub fn is_read_only(&self) -> bool
pub fn is_numeric(&self) -> bool
pub fn container(&self) -> ParentContainer
pub fn borrowed_name<'a>(&self, schema: &'a ValidatedSchema) -> &'a str
pub fn name(&self) -> &str
pub fn type_identifier(&self) -> TypeIdentifier
pub fn arity(&self) -> FieldArity
pub fn internal_enum(&self) -> Option<InternalEnum>
pub fn default_value(&self) -> Option<DefaultKind>
pub fn is_updated_at(&self) -> bool
pub fn is_auto_generated_int_id(&self) -> bool
pub fn native_type(&self) -> Option<NativeTypeInstance>
pub fn parse_json_datetime( &self, value: &str ) -> ParseResult<DateTime<FixedOffset>>
pub fn parse_json_bytes(&self, value: &str) -> PrismaValueResult<Vec<u8>>
pub fn is_autoincrement(&self) -> bool
source§impl Zipper<ModelId>
impl Zipper<ModelId>
pub fn name(&self) -> &str
sourcepub fn primary_identifier(&self) -> FieldSelection
pub fn primary_identifier(&self) -> FieldSelection
Returns the set of fields to be used as the primary identifier for a record of that model. The identifier is nothing but an internal convention to have an anchor point for querying, or in other words, the identifier is not to be mistaken for a stable, external identifier, but has to be understood as implementation detail that is used to reason over a fixed set of fields.
pub fn fields(&self) -> Fields<'_>
pub fn supports_create_operation(&self) -> bool
sourcepub fn db_name(&self) -> &str
pub fn db_name(&self) -> &str
The name of the model in the database For a sql database this will be the Table name for this model
pub fn db_name_opt(&self) -> Option<&str>
pub fn unique_indexes(&self) -> impl Iterator<Item = IndexWalker<'_>>
source§impl Zipper<RelationId>
impl Zipper<RelationId>
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.
Trait Implementations§
source§impl Debug for Zipper<TypeIdentifier>
impl Debug for Zipper<TypeIdentifier>
source§impl From<&Zipper<CompositeFieldId>> for OrderByHop
impl From<&Zipper<CompositeFieldId>> for OrderByHop
source§fn from(cf: &CompositeFieldRef) -> Self
fn from(cf: &CompositeFieldRef) -> Self
source§impl From<&Zipper<RelationFieldId>> for OrderByHop
impl From<&Zipper<RelationFieldId>> for OrderByHop
source§fn from(rf: &RelationFieldRef) -> Self
fn from(rf: &RelationFieldRef) -> Self
source§impl From<&Zipper<ScalarFieldId>> for ConditionValue
impl From<&Zipper<ScalarFieldId>> for ConditionValue
source§fn from(sf: &ScalarFieldRef) -> Self
fn from(sf: &ScalarFieldRef) -> Self
source§impl From<Zipper<CompositeFieldId>> for Field
impl From<Zipper<CompositeFieldId>> for Field
source§fn from(cf: CompositeFieldRef) -> Self
fn from(cf: CompositeFieldRef) -> Self
source§impl From<Zipper<CompositeFieldId>> for OrderByHop
impl From<Zipper<CompositeFieldId>> for OrderByHop
source§fn from(cf: CompositeFieldRef) -> Self
fn from(cf: CompositeFieldRef) -> Self
source§impl From<Zipper<CompositeTypeId>> for ParentContainer
impl From<Zipper<CompositeTypeId>> for ParentContainer
source§fn from(composite: CompositeType) -> Self
fn from(composite: CompositeType) -> Self
source§impl From<Zipper<RelationFieldId>> for Field
impl From<Zipper<RelationFieldId>> for Field
source§fn from(rf: RelationFieldRef) -> Self
fn from(rf: RelationFieldRef) -> Self
source§impl From<Zipper<RelationFieldId>> for OrderByHop
impl From<Zipper<RelationFieldId>> for OrderByHop
source§fn from(rf: RelationFieldRef) -> Self
fn from(rf: RelationFieldRef) -> Self
source§impl From<Zipper<ScalarFieldId>> for ConditionListValue
impl From<Zipper<ScalarFieldId>> for ConditionListValue
source§fn from(sf: ScalarFieldRef) -> Self
fn from(sf: ScalarFieldRef) -> Self
source§impl From<Zipper<ScalarFieldId>> for ConditionValue
impl From<Zipper<ScalarFieldId>> for ConditionValue
source§fn from(sf: ScalarFieldRef) -> Self
fn from(sf: ScalarFieldRef) -> Self
source§impl From<Zipper<ScalarFieldId>> for Field
impl From<Zipper<ScalarFieldId>> for Field
source§fn from(sf: ScalarFieldRef) -> Self
fn from(sf: ScalarFieldRef) -> Self
source§impl From<Zipper<ScalarFieldId>> for OrderBy
impl From<Zipper<ScalarFieldId>> for OrderBy
source§fn from(field: ScalarFieldRef) -> Self
fn from(field: ScalarFieldRef) -> Self
source§impl From<Zipper<ScalarFieldId>> for SelectedField
impl From<Zipper<ScalarFieldId>> for SelectedField
source§fn from(f: ScalarFieldRef) -> Self
fn from(f: ScalarFieldRef) -> Self
source§impl<I: PartialEq> PartialEq for Zipper<I>
impl<I: PartialEq> PartialEq for Zipper<I>
impl<I: Eq> Eq for Zipper<I>
Auto Trait Implementations§
impl<I> !RefUnwindSafe for Zipper<I>
impl<I> Send for Zipper<I>where I: Send,
impl<I> Sync for Zipper<I>where I: Sync,
impl<I> Unpin for Zipper<I>where I: Unpin,
impl<I> !UnwindSafe for Zipper<I>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere T: Hash + ?Sized,
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.