DdlGenerator class abstract

Abstract interface for generating DDL statements from diff operations.

Each database dialect provides its own implementation, and its package's lib/ddl.dart defines a main method serving it (through package:raindrop/ddl_server.dart) so the CLI can execute it dynamically:

void main(List<String> args, SendPort sendPort) =>
    serveDdlGenerator(MyDdlGenerator(), sendPort);

class MyDdlGenerator extends DdlGenerator {
  const MyDdlGenerator() : super(dialect: const MyDialect());

  ...
}
Implementers

Constructors

DdlGenerator({required SqlDialect dialect})
Abstract interface for generating DDL statements from diff operations.
const

Properties

dialect → SqlDialect
The SQL dialect used by this generator.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

alterTable(AlterTable operation) String
Expresses every change operation carries, column changes, checks, and this table's index changes.
createIndex(IndexInfo index, {bool ifNotExists = false}) String
Generates a CREATE INDEX statement.
createTable(TableInfo table, {bool ifNotExists = false}) String
Generates a CREATE TABLE statement.
dropIndex(String indexName) String
Generates a DROP INDEX statement.
dropTable(String tableName) String
Generates a DROP TABLE statement.
escapeName(String name) String
Escape name through the dialect.
generate(List<DiffOperation> operations) String
Generates SQL DDL statements from a list of diff operations.
getColumnType(ColumnInfo column) String
Gets the SQL type string for a column.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
render(DiffOperation operation) String
Renders a single operation through the dialect's methods.
toString() String
A string representation of this object.
inherited

Operators

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