executeQuery

abstract fun <R> executeQuery(identifier: Int?, sql: String, mapper: (SqlCursor) -> QueryResult<R>, parameters: Int, binders: SqlPreparedStatement.() -> Unit? = null): QueryResult<R>

Execute a SQL statement and evaluate its result set using the given block.

Parameters

identifier

An opaque, unique value that can be used to implement any driver-side caching of prepared statements. If identifier is null, a fresh statement is required.

sql

The SQL string to be executed.

mapper

A lambda which is called with the cursor when the statement is executed successfully. The generic result of the lambda is returned to the caller, as soon as the mutual exclusion on the database connection ends. The cursor must not escape the block scope.

parameters

The number of bindable parameters sql contains.

binders

A lambda which is called before execution to bind any parameters to the SQL statement.