forEachObject

inline fun <T : Any> forEachObject(vararg params: Any?, fetchSize: Int, crossinline block: (T) -> Unit)

Streams the result, mapping each row onto T and handing it to block.

Carries the same constraints as forEachRow: batches of fetchSize, one running statement for the whole iteration, and no re-entering this session from block.

Parameters

params

Values for $1, $2, … in declaration order.

fetchSize

Rows per batch, or 0 for the whole result in one. Required — there is no default.

block

Invoked once per mapped row, on the calling thread.

Type Parameters

T

The type each row is mapped to.

Throws

if a row cannot be mapped onto T, or wrapping anything block throws that is not an OctaviusException.