InMemoryUnitOfWork class

A real transaction over in-memory tables: every table it was built over is snapshotted before the body runs and put back when the body returns a Left.

This is what makes a multi-write use case atomic without a database — pair it with DeleteSku or DeleteInstance. Register every table the operation touches; a table that is not registered is not rolled back. InMemoryCatalog hands you one built over all of its tables, which is the way to not have to remember.

Nothing here is durable and nothing is locked: it is the smallest thing that makes a two-write operation testable, and the shape a real adapter replaces.

Implemented types

Constructors

InMemoryUnitOfWork(Iterable<InMemoryRowSource> tables)
Creates a unit of work over tables.

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runEither<F, T>({required Future<Either<F, T>> body()}) → Future<Either<F, T>>
Runs body inside the store's transaction.
override
toString() → String
A string representation of this object.
inherited

Operators

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