Package-level declarations

Types

Link copied to clipboard
class SpreadParameters(val source: TransactionValue<*>)

A value marked by spread, filling a parameter slot with a whole map's worth of parameters.

Link copied to clipboard
class StepBuilder @PublishedApi constructor(val query: RunnableQuery<*>)

Turns a query into a step instead of running it.

Link copied to clipboard
class StepHandle<out T>(position: Int)

Names a step in a TransactionPlan, so that later steps can refer to what it will produce.

Link copied to clipboard
data class TransactionDefinition(val propagation: TransactionPropagation = TransactionPropagation.REQUIRED, val isolation: TransactionIsolationLevel? = null, val readOnly: Boolean = false, val statementTimeout: Duration? = null, val transactionTimeout: Duration? = null)

How a transaction should be run.

Link copied to clipboard

A sequence of operations to run as one transaction, assembled before any of it runs.

Link copied to clipboard
class TransactionPlanResult(results: Map<StepHandle<*>, Any?>, val size: Int)

What a TransactionPlan produced, by step.

Link copied to clipboard

What a transaction does when it is started inside one that is already running.

Link copied to clipboard
class TransactionStep<T> @PublishedApi constructor(val query: RunnableQuery<*>, val params: Map<String, Any?>, val run: (Map<String, Any?>) -> T)

One operation of a TransactionPlan, described but not yet run.

Link copied to clipboard
sealed class TransactionValue<out T>

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

Functions

Link copied to clipboard

The whole of what a plan will do, as text.

Link copied to clipboard
internal fun describeValue(value: TransactionValue<*>, stepIndices: Map<StepHandle<*>, Int>? = null): String

Renders a value as the chain that will produce it.

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
internal fun resolveParams(raw: Map<String, Any?>, results: Map<StepHandle<*>, Any?>, stepIndex: Int, stepIndices: Map<StepHandle<*>, Int>): Map<String, Any?>

Replaces the unresolved values in a step's parameters with what the earlier steps produced.

Link copied to clipboard

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

Link copied to clipboard

Wraps a value that is already known, for the occasional parameter map that mixes the two.

Link copied to clipboard

Checks what can be checked about a plan without running any of it, before a transaction is opened.