useSequence

inline fun <O : Any> ResultIterable<O>.useSequence(block: (Sequence<O>) -> Unit)

Stream all the rows of the result set out with a Sequence. Handles closing of the underlying iterator.

handle.createQuery(...).mapTo<Result>().useSequence { var firstResult = it.first() }