SchemaBuilder class Null safety

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.
read / write
hashCode int
The hash code for this object.
read-onlyinherited
inputSchema Schema?
The starting schema of this builder.
read / write
isTemporary bool
Whether or not this builder should create temporary tables.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
schema Schema?
The resulting schema of this builder as operations are applied to it.
read / write
store PersistentStore?
The persistent store to validate and construct operations.
read / write

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 non-existent 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