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.

Constructors

Link copied to clipboard
constructor(jdbcTemplate: JdbcTemplate, kotlinToPostgresConverter: KotlinToPostgresConverter)

Types

Link copied to clipboard
object Companion

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

Executes a modifying query and returns the number of affected rows.