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>

source

pub fn name(&self) -> &str

source

pub fn fields(&self) -> impl Iterator<Item = Field> + '_

source

pub fn find_field(&self, prisma_name: &str) -> Option<Field>

source

pub fn find_field_by_db_name(&self, db_name: &str) -> Option<Field>

source§

impl Zipper<CompositeFieldId>

source

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

source

pub fn arity(&self) -> FieldArity

source

pub fn typ(&self) -> CompositeType

source

pub fn is_list(&self) -> bool

source

pub fn is_required(&self) -> bool

source

pub fn is_optional(&self) -> bool

source

pub fn name(&self) -> &str

source

pub fn db_name(&self) -> &str

source

pub fn container(&self) -> ParentContainer

source§

impl Zipper<RelationFieldId>

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>

source§

impl Zipper<ScalarFieldId>

source

pub fn is_id(&self) -> bool

source

pub fn is_list(&self) -> bool

source

pub fn is_required(&self) -> bool

source

pub fn unique(&self) -> bool

source

pub fn db_name(&self) -> &str

source

pub fn type_identifier_with_arity(&self) -> (TypeIdentifier, FieldArity)

source

pub fn is_read_only(&self) -> bool

source

pub fn is_numeric(&self) -> bool

source

pub fn container(&self) -> ParentContainer

source

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

source

pub fn name(&self) -> &str

source

pub fn type_identifier(&self) -> TypeIdentifier

source

pub fn arity(&self) -> FieldArity

source

pub fn internal_enum(&self) -> Option<InternalEnum>

source

pub fn default_value(&self) -> Option<DefaultKind>

source

pub fn is_updated_at(&self) -> bool

source

pub fn is_auto_generated_int_id(&self) -> bool

source

pub fn native_type(&self) -> Option<NativeTypeInstance>

source

pub fn parse_json_datetime( &self, value: &str ) -> ParseResult<DateTime<FixedOffset>>

source

pub fn parse_json_bytes(&self, value: &str) -> PrismaValueResult<Vec<u8>>

source

pub fn is_autoincrement(&self) -> bool

source§

impl Zipper<EnumId>

source

pub fn name(&self) -> &str

source

pub fn db_name(&self) -> &str

source

pub fn schema_name(&self) -> Option<&str>

source§

impl Zipper<ModelId>

source

pub fn name(&self) -> &str

source

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.

source

pub fn fields(&self) -> Fields<'_>

source

pub fn supports_create_operation(&self) -> bool

source

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

source

pub fn db_name_opt(&self) -> Option<&str>

source

pub fn unique_indexes(&self) -> impl Iterator<Item = IndexWalker<'_>>

source§

impl Zipper<RelationId>

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.

source§

impl<I: Copy> Zipper<I>

source

pub fn walker(&self) -> Walker<'_, I>

Trait Implementations§

source§

impl<I: Clone> Clone for Zipper<I>

source§

fn clone(&self) -> Zipper<I>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Zipper<TypeIdentifier>

source§

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

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

impl From<&Zipper<CompositeFieldId>> for OrderByHop

source§

fn from(cf: &CompositeFieldRef) -> Self

Converts to this type from the input type.
source§

impl From<&Zipper<ModelId>> for ParentContainer

source§

fn from(model: &Model) -> Self

Converts to this type from the input type.
source§

impl From<&Zipper<RelationFieldId>> for OrderByHop

source§

fn from(rf: &RelationFieldRef) -> Self

Converts to this type from the input type.
source§

impl From<&Zipper<ScalarFieldId>> for ConditionValue

source§

fn from(sf: &ScalarFieldRef) -> Self

Converts to this type from the input type.
source§

impl From<Zipper<CompositeFieldId>> for Field

source§

fn from(cf: CompositeFieldRef) -> Self

Converts to this type from the input type.
source§

impl From<Zipper<CompositeFieldId>> for OrderByHop

source§

fn from(cf: CompositeFieldRef) -> Self

Converts to this type from the input type.
source§

impl From<Zipper<CompositeTypeId>> for ParentContainer

source§

fn from(composite: CompositeType) -> Self

Converts to this type from the input type.
source§

impl From<Zipper<ModelId>> for ParentContainer

source§

fn from(model: Model) -> Self

Converts to this type from the input type.
source§

impl From<Zipper<RelationFieldId>> for Field

source§

fn from(rf: RelationFieldRef) -> Self

Converts to this type from the input type.
source§

impl From<Zipper<RelationFieldId>> for OrderByHop

source§

fn from(rf: RelationFieldRef) -> Self

Converts to this type from the input type.
source§

impl From<Zipper<ScalarFieldId>> for ConditionListValue

source§

fn from(sf: ScalarFieldRef) -> Self

Converts to this type from the input type.
source§

impl From<Zipper<ScalarFieldId>> for ConditionValue

source§

fn from(sf: ScalarFieldRef) -> Self

Converts to this type from the input type.
source§

impl From<Zipper<ScalarFieldId>> for Field

source§

fn from(sf: ScalarFieldRef) -> Self

Converts to this type from the input type.
source§

impl From<Zipper<ScalarFieldId>> for OrderBy

source§

fn from(field: ScalarFieldRef) -> Self

Converts to this type from the input type.
source§

impl From<Zipper<ScalarFieldId>> for SelectedField

source§

fn from(f: ScalarFieldRef) -> Self

Converts to this type from the input type.
source§

impl<I: Hash> Hash for Zipper<I>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<I: PartialEq> PartialEq for Zipper<I>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CallHasher for Twhere T: Hash + ?Sized,

source§

fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64where H: Hash + ?Sized, B: BuildHasher,

source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V