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 anast::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 anast::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 anast::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 anast::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
- A node containing attributes.
- In an model attribute definition
- A cursor position in a context.
- In an enum value.
- Represents arbitrary, even nested, expressions.
- An arity of a data model field.
- In a scalar field.
- Defines the indentation of a PSL block.
- A cursor position in a context.
- Defines the newline type of a PSL block.
- A cursor position in a schema.
- Enum for distinguishing between top-level entries
- An identifier for a top-level item in a schema AST. Use the
schema[top_id]
syntax to resolve the id to anast::Top
.
Traits
- An AST node with attributes.
- An AST node with documentation.
- An AST node with an identifier.
- An AST node with a name (from the identifier).
- An AST node with a span.