forEachRow

fun forEachRow(params: Map<String, Any?> = emptyMap(), fetchSize: Int, block: (Row) -> Unit)

Runs the query and hands each row to block as it arrives, in batches of fetchSize.

The session stays open for the whole walk, so this streams a result too large to hold rather than materialising it first. block runs on that session, and the driver serialises nested use of one connection, so keep the body to the row.

Parameters

fetchSize

Rows per batch, or 0 for the whole result in one Execute. Required, as it is on the driver.


fun forEachRow(vararg params: Pair<String, Any?>, fetchSize: Int, block: (Row) -> Unit)

Runs the query and hands each row to block as it arrives, in batches of fetchSize.