PostgresqlSchemaApplier class
Builds PostgreSQL DDL statements from schema definitions.
Constructors
- PostgresqlSchemaApplier()
-
Creates a PostgreSQL schema applier.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addColumnStatement(
String modelName, FieldDefinition field) → String -
Returns an
ALTER TABLE ... ADD COLUMNstatement forfield. -
addColumnStatementForModel(
ModelDefinition model, FieldDefinition field, {SchemaDocument? schema}) → String - Returns an add-column statement using mapped model and field names.
-
addForeignKeyConstraintStatementForModel(
ModelDefinition model, FieldDefinition field, {SchemaDocument? schema}) → String? - Returns an add-constraint statement for a relation field, if applicable.
-
apply(
SessionExecutor executor, SchemaDocument schema) → Future< void> -
Applies the schema to
executorusing create-if-missing semantics. -
columnDefinition(
FieldDefinition field, {SchemaDocument? schema}) → String -
Returns a PostgreSQL column definition for
field. -
createEnumStatement(
EnumDefinition definition) → String - Returns a PostgreSQL enum creation statement.
-
createEnumStatements(
SchemaDocument schema) → List< String> -
Returns DDL for every enum in
schema. -
createImplicitManyToManyTableStatement(
ImplicitManyToManyStorageDefinition storage) → String -
Returns a join-table creation statement for
storage. -
createImplicitManyToManyTableStatements(
SchemaDocument schema) → List< String> - Returns creation statements for implicit many-to-many tables.
-
createSchemaStatements(
SchemaDocument schema) → List< String> - Returns DDL needed to create the whole schema.
-
createTableStatementForModel(
ModelDefinition model, {SchemaDocument? schema}) → String -
Returns a table creation statement for
model. -
createTableStatements(
SchemaDocument schema) → List< String> -
Returns table creation statements for every model in
schema. -
dropForeignKeyConstraintStatementForModel(
ModelDefinition model, FieldDefinition field) → String? - Returns a drop-constraint statement for a relation field, if applicable.
-
foreignKeyConstraintDefinitionForModel(
ModelDefinition model, FieldDefinition field, {SchemaDocument? schema}) → String? -
Returns the foreign key definition fragment for
field, if any. -
foreignKeyConstraintNameForModel(
ModelDefinition model, FieldDefinition field) → String? -
Returns the conventional foreign key constraint name for
field. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
postgresTypeForField(
FieldDefinition field, {SchemaDocument? schema}) → String -
Returns the PostgreSQL column type used for
field. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited