SchemaDocument class

Parsed schema.prisma document.

Annotations
  • @immutable

Constructors

SchemaDocument({required List<ModelDefinition> models, List<EnumDefinition> enums = const <EnumDefinition>[], List<DatasourceDefinition> datasources = const <DatasourceDefinition>[], List<GeneratorDefinition> generators = const <GeneratorDefinition>[]})
Creates a schema document.
const

Properties

datasources List<DatasourceDefinition>
Datasource declarations in source order.
final
enums List<EnumDefinition>
Enum declarations in source order.
final
generators List<GeneratorDefinition>
Generator declarations in source order.
final
hashCode int
The hash code for this object.
no setterinherited
models List<ModelDefinition>
Model declarations in source order.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

findDatasource(String name) DatasourceDefinition?
Finds a datasource definition by name.
findEnum(String name) EnumDefinition?
Finds an enum definition by name.
findEnumByDatabaseName(String databaseName) EnumDefinition?
Finds an enum definition by its mapped database type name.
findGenerator(String name) GeneratorDefinition?
Finds a generator definition by name.
findModel(String name) ModelDefinition?
Finds a model definition by name.
findModelByDatabaseName(String databaseName) ModelDefinition?
Finds a model definition by its mapped database table name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
withoutIgnored() SchemaDocument
Returns a copy of the schema with @ignore / @@ignore members removed.

Operators

operator ==(Object other) bool
The equality operator.
inherited