forEachRow

inline fun PreparedStatement.forEachRow(action: (Row) -> Unit)(source)

Calls action once for every Row produced by stepping this statement, until it's exhausted. Equivalent to manually looping on step, generateSequence(::step).forEach(action) for that matter, but without the intermediate Sequence.

The Row passed to action follows the same rule as one returned by step directly, valid only for that single call, holding on to it past that throws IllegalStateException.

Throws

if an error occurs while executing the statement.