zio.blocks.data.migration
Members list
Type members
Classlikes
This object was generated by sbt-buildinfo.
This object was generated by sbt-buildinfo.
Attributes
- Source
- BuildInfo.scala
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Self type
-
BuildInfo.type
Semantic version for data schemas.
Semantic version for data schemas.
Value parameters
- epoch
-
Major breaking epoch (incompatible with prior epochs)
- major
-
Major version within epoch
- minor
-
Minor/patch version
- timestampMillis
-
Optional creation timestamp (epoch millis)
Attributes
- Source
- core.scala
- Supertypes
Execution model for migration strategies.
Execution model for migration strategies.
- Tiny: in-memory, single-transaction, minimal overhead
- Small: batch-oriented, moderate resource use
- Large: streaming/out-of-core, resumable, high resource tolerance
Attributes
- Companion
- object
- Source
- core.scala
- Supertypes
- Known subtypes
Attributes
- Companion
- trait
- Source
- core.scala
- Supertypes
- Self type
-
ExecutionModel.type
B-Large: incremental worker that processes migration queue until empty. Supports pause/resume and progress reporting.
B-Large: incremental worker that processes migration queue until empty. Supports pause/resume and progress reporting.
The lifecycle methods (init, fence, drain, complete) are internally consistent but are expected to be driven from a single thread; pause and resume are safe to call from other threads while run() or drain() is in flight.
Attributes
- Source
- LargeMigrator.scala
- Supertypes
Helpers for the optional data_migrations metadata table.
Helpers for the optional data_migrations metadata table.
Stores provenance for migrated aggregates when resume/re-processing or audit trails are required. Not required for simple in-place migrations.
Attributes
- Source
- MigrationMetadata.scala
- Supertypes
- Self type
-
MigrationMetadata.type
Helpers for migration queue tables used by migration workers, dialect-driven to support both PostgreSQL and SQLite.
Helpers for migration queue tables used by migration workers, dialect-driven to support both PostgreSQL and SQLite.
Queue tables store IDs of aggregates pending migration. Workers dequeue batches via SELECT ... FOR UPDATE SKIP LOCKED on PostgreSQL; SQLite uses a plain LIMIT with the write lock held via IMMEDIATE (SQLite connections via JdbcTransactor.fromUrl/sqlite or any pooled/wrapped DataSource are configured per-transaction with busy_timeout=5000 and IMMEDIATE via isWrapperFor/unwrap, so transact reserves the write lock and waits on contention; connect is configured similarly but does not begin a transaction or reserve the lock — only transact issues BEGIN IMMEDIATE; see PR #1534 discussion_r3863454094).
Attributes
- Source
- QueueTable.scala
- Supertypes
- Self type
-
QueueTable.type
Helpers for creating and swapping shadow tables during large migrations.
Helpers for creating and swapping shadow tables during large migrations.
Pattern: CREATE TABLE users_v2 LIKE users; migrate into v2; swap atomically.
Attributes
- Source
- ShadowTable.scala
- Supertypes
- Self type
-
ShadowTable.type
A-Small: queue-based batch migration worker.
A-Small: queue-based batch migration worker.
Dequeues IDs from a queue table, reads entities via Repo.findAll, applies Migration[A,B], and writes to the target repo. Rows whose source entity no longer exists are deleted from the target (ADR Decision 3). One transaction per batch. Supports both in-place and shadow targets.
Attributes
- Source
- SmallMigrator.scala
- Supertypes
Attributes
- Companion
- trait
- Source
- core.scala
- Supertypes
- Self type
-
TargetStrategy.type
Target write strategy (orthogonal to ExecutionModel).
Target write strategy (orthogonal to ExecutionModel).
- InPlace: mutate existing table/storage
- ShadowTable: suffix appended to the base table name, then swap/rename
Attributes
- Companion
- object
- Source
- core.scala
- Supertypes
- Known subtypes
-
object InPlaceclass ShadowTable
Applies a TargetStrategy, providing the actual table name to write to and handling shadow table lifecycle (create, write, swap).
Applies a TargetStrategy, providing the actual table name to write to and handling shadow table lifecycle (create, write, swap).
Attributes
- Source
- TargetStrategyApplier.scala
- Supertypes
- Self type
A-Tiny: startup migration that runs schema DDL within a single transaction.
A-Tiny: startup migration that runs schema DDL within a single transaction.
Usage:
class MyStartupMigrations(transactor: Transactor) extends TinyMigrator(transactor) {
def run()(using tx: DbTx): Unit = {
Ddl.createTable("users", IndexedSeq(
ColumnDef("id", "BIGSERIAL", nullable = false),
ColumnDef("email", "TEXT", nullable = false)
)).update
}
}
Attributes
- Source
- TinyMigrator.scala
- Supertypes