TransactionValue

sealed class TransactionValue<out T>

A parameter value in a TransactionPlan step, which may not exist yet.

A plan is assembled before any of it runs, so a step that needs the id of a row a previous step will insert cannot be handed that id - there is none. It is handed one of these instead, and the executor replaces it with the real value at the moment the step runs.

Anything that is not one of these is passed through untouched, so an ordinary parameter map needs no wrapping: only the values that depend on an earlier step do.

Type Parameters

T

The type the value will have once resolved.

Inheritors

Constructors

Link copied to clipboard
protected constructor()

Types

Link copied to clipboard
data class FromStep<out T>(val handle: StepHandle<T>) : TransactionValue<T>

An earlier step's result, whole and as its terminal produced it.

Link copied to clipboard
class Transformed<IN, out OUT>(val source: TransactionValue<IN>, val transform: (IN) -> OUT) : TransactionValue<OUT>

Another value with a function applied to it, run when that value is resolved.

Link copied to clipboard
data class Value<out T>(val value: T) : TransactionValue<T>

A value that was known all along. Rarely written by hand; toTransactionValue is shorter.

Functions

Link copied to clipboard
fun <IN, OUT> TransactionValue<IN>.map(transformation: (IN) -> OUT): TransactionValue<OUT>

Applies transformation to this value once it resolves.

Link copied to clipboard

Marks this map to be spread into parameters of its own rather than assigned to one.