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, and references 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

Type Aliases