StepBuilder

class StepBuilder @PublishedApi constructor(val query: RunnableQuery<*>)

Turns a query into a TransactionPlan step instead of running it; returned by RunnableQuery.asStep.

It has the fetch* terminals and executeUpdate. There is no forEach*, a plan keeping every result, and no RawQuery.execute, which binds nothing and so could take no TransactionValue. Parameters may hold TransactionValues and SpreadParameters among ordinary values.

Constructors

Link copied to clipboard
internal constructor(query: RunnableQuery<*>)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun executeUpdate(params: Map<String, Any?> = emptyMap()): TransactionStep<Long>
fun executeUpdate(vararg params: Pair<String, Any?>): TransactionStep<Long>

A step that runs the statement and returns how many rows it affected.

Link copied to clipboard
inline fun <T> fetchField(params: Map<String, Any?> = emptyMap()): TransactionStep<T>
inline fun <T> fetchField(vararg params: Pair<String, Any?>): TransactionStep<T>

A step that returns the first column of one row as T.

Link copied to clipboard
inline fun <T> fetchFields(params: Map<String, Any?> = emptyMap()): TransactionStep<List<T>>
inline fun <T> fetchFields(vararg params: Pair<String, Any?>): TransactionStep<List<T>>

A step that returns the first column of every row as T.

Link copied to clipboard
inline fun <T> fetchFieldStrict(params: Map<String, Any?> = emptyMap()): TransactionStep<T>
inline fun <T> fetchFieldStrict(vararg params: Pair<String, Any?>): TransactionStep<T>

As fetchField, but the step's query must return exactly one row.

Link copied to clipboard
inline fun <T : Any> fetchObject(params: Map<String, Any?> = emptyMap()): TransactionStep<T?>
inline fun <T : Any> fetchObject(vararg params: Pair<String, Any?>): TransactionStep<T?>

A step that maps one row onto T, or null where none matched.

Link copied to clipboard
inline fun <T : Any> fetchObjects(params: Map<String, Any?> = emptyMap()): TransactionStep<List<T>>
inline fun <T : Any> fetchObjects(vararg params: Pair<String, Any?>): TransactionStep<List<T>>

A step that maps every row onto T.

Link copied to clipboard
inline fun <T : Any> fetchObjectStrict(params: Map<String, Any?> = emptyMap()): TransactionStep<T>
inline fun <T : Any> fetchObjectStrict(vararg params: Pair<String, Any?>): TransactionStep<T>

A step that maps one row onto T and fails where the count was anything but one.

Link copied to clipboard
fun fetchRow(params: Map<String, Any?> = emptyMap()): TransactionStep<Row?>
fun fetchRow(vararg params: Pair<String, Any?>): TransactionStep<Row?>

A step that returns one row, or null where none matched.

Link copied to clipboard
fun fetchRows(params: Map<String, Any?> = emptyMap()): TransactionStep<List<Row>>
fun fetchRows(vararg params: Pair<String, Any?>): TransactionStep<List<Row>>

A step that returns every row.

Link copied to clipboard
fun fetchRowStrict(params: Map<String, Any?> = emptyMap()): TransactionStep<Row>
fun fetchRowStrict(vararg params: Pair<String, Any?>): TransactionStep<Row>

A step that returns one row and fails where the count was anything but one.