QueryExecutor
internal class QueryExecutor(jdbcTemplate: JdbcTemplate, kotlinToPostgresConverter: KotlinToPostgresConverter)
Internal component responsible for executing SQL queries.
Centralizes logic for:
Converting SQL with named parameters to positional parameters.
Logging executed queries.
Exception translation.
Interaction with JdbcTemplate.
Functions
Link copied to clipboard
fun <M, R> executeQuery(sql: String, params: Map<String, Any?>, rowMapper: RowMapper<M>, options: InternalQueryOptions, transform: (List<M>) -> DataResult<R>): DataResult<R>
Executes a query that returns a list of results and transforms them.
Link copied to clipboard
fun <M> executeStream(sql: String, params: Map<String, Any?>, fetchSize: Int, rowMapper: RowMapper<M>, options: InternalQueryOptions, action: (item: M) -> Unit): DataResult<Unit>
Executes a query and streams the results row by row.
Link copied to clipboard
fun executeUpdate(sql: String, params: Map<String, Any?>, options: InternalQueryOptions): DataResult<Int>
Executes a modifying query and returns the number of affected rows.