forEachRowOf

abstract fun <T : Any> forEachRowOf(kClass: KClass<T>, params: Map<String, Any?>, action: (obj: T) -> Unit): DataResult<Unit>

Executes the query and processes each row individually using the provided action, without loading the entire result into memory. Ideal for large datasets. Returns DataResult.Success(Unit) if the operation succeeded or DataResult.Failure in case of error.

Parameters

params

Query parameters.

action

Function that will be executed for each row. The row is mapped to a data class.