Module parser_database::walkers
source · Expand description
Convenient access to a datamodel as understood by ParserDatabase.
The walkers:
- Know about specific types and what kind they are (models, enums, etc.)
- Know about attributes and which ones are defined and allowed in a Prisma schema.
- Know about relations.
- Do not know anything about connectors, they are generic.
Structs
- Represents a relation that has fields and references defined in one of the relation fields. Includes 1:1 and 1:n relations that are defined from both sides.
- An
@default()
attribute on a field. - A table name for an implicit relation’s join table. Useful for its Display impl.
- An index, unique or fulltext attribute.
- An explicitly defined 1:1 or 1:n relation. The walker has the referencing side defined, but might miss the back relation in the AST.
- An operator class defines the operators allowed in an index. Mostly a PostgreSQL thing.
- An
@(@)id
attribute in the schema. - An opaque identifier for a model relation field in a schema.
- A scalar field as referenced in a key specification (id, index or unique).
- Describes an explicit m:n relation between two models. Both sides define
fields
which must be a single array scalar field, andreferences
that should point to a single scalar field on the referenced model. - A model or composite type field of a scalar type.
- A generic walker. Only walkers intantiated with a concrete ID type (
I
) are useful.
Enums
- A field in an index definition. It can point to a scalar field in the current model, or through embedding a field in a composite type.
- A field that has been identified as scalar field or relation field.
- Splits the relation to different types.
- The relation name.
Type Aliases
- A field in a composite type.
- A composite type, introduced with the
type
keyword in the schema. - One value in an
enum
declaration in the schema. - An
enum
declaration in the schema. - A model field, scalar or relation.
- Describes an implicit m:n relation between two models. Neither side defines fields, attributes or referential actions, which are all inferred by Prisma.
- A
model
declaration in the Prisma schema. - A relation field on a model in the schema.
- A relation that has the minimal amount of information for us to create one. Useful for validation purposes. Holds all possible relation types.
- A scalar field, as part of a model.