DynamicMigration

zio.blocks.schema.migration.DynamicMigration
See theDynamicMigration companion object
final case class DynamicMigration(actions: Chunk[MigrationAction])

A pure, serializable migration that operates on DynamicValue. This is the untyped core of the migration system, containing a sequence of MigrationActions that are applied in order.

DynamicMigration is fully serializable because:

  • It contains no closures or functions
  • All transformations are represented as DynamicSchemaExpr
  • All paths are represented as data (DynamicOptic)

This enables migrations to be:

  • Stored in registries
  • Transmitted over the network
  • Applied dynamically
  • Inspected and transformed
  • Used to generate SQL DDL, upgraders, etc.

Attributes

Companion
object
Source
DynamicMigration.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Compose this migration with another, applying this migration first, then the other.

Compose this migration with another, applying this migration first, then the other.

Value parameters

that

The migration to apply after this one

Attributes

Returns

A new migration that applies both in sequence

Source
DynamicMigration.scala

Alias for ++.

Alias for ++.

Attributes

Source
DynamicMigration.scala
def apply(value: DynamicValue): Either[SchemaError, DynamicValue]

Apply this migration to a DynamicValue.

Apply this migration to a DynamicValue.

Value parameters

value

The input value to migrate

Attributes

Returns

Either a SchemaError or the migrated value

Source
DynamicMigration.scala
def isEmpty: Boolean

Returns true if this migration has no actions (identity migration).

Returns true if this migration has no actions (identity migration).

Attributes

Source
DynamicMigration.scala

Returns the structural reverse of this migration. The reverse migration has all actions reversed and in reverse order.

Returns the structural reverse of this migration. The reverse migration has all actions reversed and in reverse order.

Note: Runtime execution of the reverse migration is best-effort. It may fail if information was lost during the forward migration (e.g., dropping a field without capturing its value).

Attributes

Source
DynamicMigration.scala
def size: Int

Returns the number of actions in this migration.

Returns the number of actions in this migration.

Attributes

Source
DynamicMigration.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala