Module parser_database::ast

source ·
Expand description

The AST data structure. It aims to faithfully represent the syntax of a Prisma Schema, with source span information.

Structs

  • An argument, either for attributes or for function call expressions.
  • A list of arguments inside parentheses.
  • An attribute (following @ or `@@``) on a model, model field, enum, enum value or composite type field.
  • An attribute (@ or @@) node in the AST.
  • A type declaration in the data model. Defined by a type keyword and a block of fields that can be embedded in a model.
  • An opaque identifier for a type definition in a schema AST. Use the schema[type_id] syntax to resolve the id to an ast::CompositeType.
  • A named property in a config block.
  • An argument with a name but no value. Example:
  • An enum declaration. Enumeration can either be in the database schema, or completely a Prisma level concept.
  • An opaque identifier for an enum in a schema AST.
  • An enum value definition.
  • An opaque identifier for a value in an AST enum. Use the r#enum[enum_value_id] syntax to resolve the id to an ast::EnumValue.
  • A field definition in a model or a composite type.
  • An opaque identifier for a field in an AST model. Use the model[field_id] syntax to resolve the id to an ast::Field.
  • A Generator block declaration.
  • An opaque identifier for a generator block in a schema AST.
  • An identifier.
  • A model declaration.
  • An opaque identifier for a model in a schema AST. Use the schema[model_id] syntax to resolve the id to an ast::Model.
  • AST representation of a prisma schema.
  • A source block declaration.
  • An opaque identifier for a datasource block in a schema AST.
  • Represents a location in a datamodel’s text representation.

Enums

Traits