dorm_migrations library

Portable, ordered migrations for dORM engines.

Classes

AddFieldOperation
Adds a field to an entity.
AllFilterExpression
AlterFieldOperation
Changes the declared definition of an existing field.
AnyFilterExpression
BackfillFieldOperation
Writes a constant value to existing records.
ComparisonFilterExpression
ContainsAnyFilterExpression
ContainsFilterExpression
ConvertMigrationValue
Converts a stored value to one of the framework's logical types.
CopyFieldOperation
Copies values from one stored field to another.
CopyMigrationValue
Copies a value from another stored field.
CreateCheckConstraintOperation
Creates a check constraint on an entity.
CreateEntityOperation
Creates an entity or collection.
CreateForeignKeyOperation
Creates a foreign key constraint on an entity.
CreateIndexOperation
Creates an index or unique index on an entity.
CreateSequenceOperation
Creates a database sequence.
CreateTriggerOperation
Creates a SQL trigger.
CreateUniqueConstraintOperation
Creates a database-level uniqueness constraint.
CreateViewOperation
Creates a SQL view.
DateFilterExpression
DocumentMigrationAdapter
Applies document-oriented migrations.
DocumentMigrationBackend
The minimal access required by DocumentMigrationAdapter.
DocumentMigrationCheckpoint
A persisted position for an interrupted document operation.
DocumentMigrationLeaseBackend
Adds persistent lease support to a document migration backend.
DocumentMigrationOperationContextAdapter
Gives a document adapter the migration and operation currently executing.
DocumentMigrationPagingBackend
Provides stable, cursor-based pages for large document collections.
DocumentMigrationPerformanceOptions
Controls page size, throttling, and resumable limits for document work.
DropCheckConstraintOperation
Removes a check constraint from an entity.
DropEntityOperation
Removes an entity or collection.
DropForeignKeyOperation
Removes a foreign key constraint from an entity.
DropIndexOperation
Removes an index or unique index from an entity.
DropSequenceOperation
Removes a database sequence.
DropTriggerOperation
Removes a SQL trigger.
DropUniqueConstraintOperation
Removes a database-level uniqueness constraint.
DropViewOperation
Removes a SQL view.
EmptyFilterExpression
FilterExpression
FilterRange<T>
MemoryMigrationAdapter
An adapter useful for tests and process-local tooling.
Migration
A named, ordered set of operations.
MigrationAdapter
Applies migrations and stores their completed versions.
MigrationCapableEngine
An optional capability implemented by engines with migration support.
MigrationCheckConstraintDefinition
Describes a check constraint expected on an entity.
MigrationChecksum
Creates a stable digest for a migration's logical operations.
MigrationDocument
A record read by a document-oriented migration backend.
MigrationDocumentPage
A page of documents returned in a stable traversal order.
MigrationEntityDefinition
Describes an entity involved in a structural migration.
MigrationFieldDefinition
Describes a field as it is expected to be stored by a migration.
MigrationForeignKeyDefinition
Describes a foreign key expected on an entity.
MigrationGraph
Orders migrations while checking optional branch and merge dependencies.
MigrationHistoryCompactionAdapter
An optional capability for compacting completed migration history.
MigrationHistoryEntry
A migration recorded by a backend.
MigrationIndexDefinition
Describes an index expected on an entity.
MigrationLease
A backend-owned lease used to coordinate migration runners.
MigrationLeaseAdapter
An optional persistent-lock capability for MigrationAdapter.
MigrationLogEntry
A structured log record emitted by MigrationRunner.
MigrationMetric
A completed duration measurement emitted by MigrationRunner.
MigrationOperation
A logical database operation that a backend adapter can apply.
MigrationProgress
A typed progress event emitted by MigrationRunner.
MigrationRunner
Runs ordered migrations through an engine-specific adapter.
MigrationRunResult
The result of one migration run.
MigrationRuntime
Resources required to execute a migration command.
MigrationSchemaDifference
Describes one detected schema difference.
MigrationSchemaInspector
An optional capability for reading a backend's live schema.
MigrationSchemaSnapshot
A normalized view of the schema currently known by a migration backend.
MigrationSchemaValidationResult
The result of comparing an expected schema with a live schema.
MigrationSchemaValidator
Compares normalized schemas without depending on a provider SDK.
MigrationSequenceDefinition
Describes a database sequence managed by a migration.
MigrationStatusReport
Describes the migration history without changing the backend.
MigrationTriggerDefinition
Describes a SQL trigger managed by a migration.
MigrationUniqueConstraintDefinition
Describes a unique constraint expected on an entity.
MigrationValueTransform
Describes a typed, provider-neutral value transformation.
MigrationViewDefinition
Describes a SQL view managed by a migration.
NotFilterExpression
NullFilterExpression
ProviderMigrationOperation
Describes an operation understood only by a named provider.
RangeFilterExpression<T>
RemoveFieldOperation
Removes a field from an entity.
RemoveFieldValueOperation
Clears a field value on existing records by storing null.
RenameFieldOperation
Renames a stored field without changing its value.
SetFilterExpression
SqlMigrationAdapter
Applies logical migration operations using SQL DDL and DML.
SqlMigrationBackend
The minimal database access required by SqlMigrationAdapter.
SqlMigrationFieldDefinition
Adds physical type overrides for SQL dialects to a logical field.
SqlMigrationScript
A deterministic SQL preview that has not been executed.
SqlMigrationStatement
A SQL statement emitted by SqlMigrationAdapter.preview.
TextFilterExpression
TextMigrationValue
Applies a text operation to a stored string field.
TransactionalMigrationAdapter
An optional transaction capability for MigrationAdapter.
TransactionalSqlMigrationBackend
SQL backend access with a transaction boundary for migration work.
TransformFieldOperation
Transforms values in existing records using a portable expression.
ValueFilterExpression

Enums

DateFilterUnit
FilterComparisonOperator
Operators for scalar comparisons supported by an extended query.
MigrationDestructivePolicy
Controls whether pending migrations may remove or overwrite stored data.
MigrationLockMode
Describes how an adapter prevents concurrent migration runs.
MigrationLogLevel
MigrationOperationSafety
Describes whether an operation can remove or overwrite stored data.
MigrationProgressStage
Identifies a lifecycle point emitted while migrations run.
MigrationReferentialAction
The referential action applied when a referenced row changes.
MigrationSchemaDifferenceKind
The part of a live schema that differs from the expected schema.
MigrationTextTransform
The supported operations for a declarative field transformation.
MigrationTransactionMode
Describes the strongest transaction boundary a migration adapter provides.
MigrationValueType
The portable value kinds understood by migration adapters.
SqlMigrationDialect
The SQL families supported by the portable SQL adapter.

Extensions

MigrationOperationClassification on MigrationOperation
Classifies the data-loss risk of a migration operation.

Functions

runMigrationCommand(List<String> arguments, {required MigrationRuntimeFactory open, required Iterable<Migration> migrations}) Future<int>
Runs the project-owned migration command.

Typedefs

MigrationLogCallback = void Function(MigrationLogEntry entry)
MigrationMetricCallback = void Function(MigrationMetric metric)
MigrationOperationValidator = Future<void> Function(Migration migration, int operationIndex, MigrationOperation operation)
Checks an operation against project-specific data or deployment rules.
MigrationProgressCallback = void Function(MigrationProgress event)
MigrationRuntimeFactory = FutureOr<MigrationRuntime> Function()
Opens the adapter and any resources required by a migration process.

Exceptions / Errors

DocumentMigrationBatchLimitException
Thrown after a page is checkpointed because an operation reached its limit.
MigrationDestructiveOperationException
Thrown when the runner encounters a destructive operation without opt-in.
MigrationGraphException
Errors found while validating migration dependencies.
MigrationLeaseException
A failure to acquire, renew, verify, or release a migration lease.
MigrationSchemaDriftException
Thrown when a live backend schema does not match the expected schema.
MigrationUnsupportedException
Signals that a backend cannot represent a requested migration operation.
MigrationValidationException
Thrown when a migration list cannot be executed safely.