withStatement

open fun <R, E : Exception?> withStatement(@Language(value = "PostgreSQL") sql: String, statementFunction: StatementFunction<R, E>): R(source)

Creates a statement from the given SQL statement, runs the function and closes the statement.

Parameters

sql

An SQL statement that may contain one or more '?' IN parameter placeholders

statementFunction

The function to run with the prepared statement


open fun <R, E : Exception?> withStatement(@Language(value = "PostgreSQL") sql: String, columnIndexes: Array<Int>, statementFunction: StatementFunction<R, E>): R(source)

Creates a statement from the given SQL statement, runs the function and closes the statement.

Parameters

sql

An SQL statement that may contain one or more '?' IN parameter placeholders

columnIndexes

An array of column indexes indicating the columns that should be returned from the inserted row or rows

statementFunction

The function to run with the prepared statement


open fun <R, E : Exception?> withStatement(@Language(value = "PostgreSQL") sql: String, columnNames: Array<String>, statementFunction: StatementFunction<R, E>): R(source)

Creates a statement from the given SQL statement, runs the function and closes the statement.

Parameters

sql

An SQL statement that may contain one or more '?' IN parameter placeholders

columnNames

An array of column names indicating the columns that should be returned from the inserted row or rows

statementFunction

The function to run with the prepared statement