SchemaBuilder class

Generates SQL or Dart code that modifies a database schema.

Constructors

SchemaBuilder(PersistentStore? store, Schema? inputSchema, {bool? isTemporary = false})
Creates a builder starting from an existing schema.
SchemaBuilder.fromDifference(PersistentStore? store, SchemaDifference difference, {bool? isTemporary = false, List<String>? changeList})
SchemaBuilder.toSchema(PersistentStore store, Schema targetSchema, {bool isTemporary = false, List<String>? changeList})
Creates a builder starting from the empty schema.

Properties

commands List<String>
A list of commands generated by operations performed on this builder.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
inputSchema Schema?
The starting schema of this builder.
getter/setter pair
isTemporary bool?
Whether or not this builder should create temporary tables.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schema Schema?
The resulting schema of this builder as operations are applied to it.
getter/setter pair
store PersistentStore?
The persistent store to validate and construct operations.
getter/setter pair

Methods

addColumn(String tableName, SchemaColumn column, {String? unencodedInitialValue}) → void
Validates and adds a column to a table in schema.
alterColumn(String tableName, String columnName, void modify(SchemaColumn targetColumn), {String? unencodedInitialValue}) → void
Validates and alters a column in a table in schema.
alterTable(String tableName, void modify(SchemaTable targetTable)) → void
Alters a table in schema.
createTable(SchemaTable table) → void
Validates and adds a table to schema.
deleteColumn(String tableName, String columnName) → void
Validates and deletes a column in a table in schema.
deleteTable(String tableName) → void
Validates and deletes a table in schema.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
renameColumn(String tableName, String columnName, String newName) → void
Validates and renames a column in a table in schema.
renameTable(String currentTableName, String newName) → void
Validates and renames a table in schema.
toString() String
A string representation of this object.
inherited

Operators

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