Schema class

A portable representation of a database schema.

Instances of this type contain the database-only details of a ManagedDataModel and are typically instantiated from ManagedDataModels. The purpose of this type is to have a portable, differentiable representation of an application's data model for use in external tooling.


Schema(List<SchemaTable> tables)
Creates an instance of this type with a specific set of tables. [...]
Creates an empty schema.
Schema.from(Schema otherSchema)
Creates a deep copy of otherSchema.
Schema.fromDataModel(ManagedDataModel dataModel)
Creates an instance of this type from dataModel. [...]
Schema.fromMap(Map<String, dynamic> map)
Creates a instance of this type from map. [...]


tables → List<SchemaTable>
The tables in this database. [...]
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited


addTable(SchemaTable table) → void
Adds a table to this instance. [...]
asMap() → Map<String, dynamic>
Emits this instance as a transportable Map.
differenceFrom(Schema otherSchema) SchemaDifference
The differences between two schemas. [...]
removeTable(SchemaTable table) → void
Removes a table from this instance. [...]
renameTable(SchemaTable table, String newName) → void
replaceTable(SchemaTable existingTable, SchemaTable newTable) → void
tableForName(String name) SchemaTable
Returns a SchemaTable for name. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toString() → String
Returns a string representation of this object.


operator [](String tableName) SchemaTable
Gets a table from tables by that table's name. [...]
operator ==(dynamic other) → bool
The equality operator.