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.
Constructors
- Schema(List<SchemaTable> tables)
-
Creates an instance of this type with a specific set of
tables
. - Schema.empty()
-
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
.
Properties
- dependencyOrderedTables → List<SchemaTable>
-
An ordered list of tables in this schema.
read-only - tables → List<SchemaTable>
-
The tables in this database.
read-only - 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
Operators
-
operator [](
String tableName) → SchemaTable -
Gets a table from tables by that table's name.
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
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 -
tableForName(
String name) → SchemaTable -
Returns a SchemaTable for
name
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited