vertx / io.vertx.kotlin.ext.sql / io.vertx.ext.sql.SQLConnection

Extensions for io.vertx.ext.sql.SQLConnection

batchAwait

suspend fun SQLConnection.batchAwait(sqlStatements: List<String>): List<Int>

Batch simple SQL strings and execute the batch where the async result contains a array of Integers.

batchCallableWithParamsAwait

suspend fun SQLConnection.batchCallableWithParamsAwait(sqlStatement: String, inArgs: List<JsonArray>, outArgs: List<JsonArray>): List<Int>

Batch a callable statement with all entries from the args list. Each entry is a batch. The size of the lists inArgs and outArgs MUST be the equal. The operation completes with the execution of the batch where the async result contains a array of Integers.

batchWithParamsAwait

suspend fun SQLConnection.batchWithParamsAwait(sqlStatement: String, args: List<JsonArray>): List<Int>

Batch a prepared statement with all entries from the args list. Each entry is a batch. The operation completes with the execution of the batch where the async result contains a array of Integers.

callAwait

suspend fun SQLConnection.callAwait(sql: String): ResultSet

Calls the given SQL PROCEDURE which returns the result from the procedure.

callWithParamsAwait

suspend fun SQLConnection.callWithParamsAwait(sql: String, params: JsonArray, outputs: JsonArray): ResultSet

Calls the given SQL PROCEDURE which returns the result from the procedure.

closeAwait

suspend fun SQLConnection.closeAwait(): Unit

Closes the connection. Important to always close the connection when you are done so it's returned to the pool.

commitAwait

suspend fun SQLConnection.commitAwait(): Unit

Commits all changes made since the previous commit/rollback.

executeAwait

suspend fun SQLConnection.executeAwait(sql: String): Unit

Executes the given SQL statement

getTransactionIsolationAwait

suspend fun SQLConnection.getTransactionIsolationAwait(): TransactionIsolation

Attempts to return the transaction isolation level for this Connection object to the one given.

queryAwait

suspend fun SQLConnection.queryAwait(sql: String): ResultSet

Executes the given SQL SELECT statement which returns the results of the query.

querySingleAwait

suspend fun SQLConnection.querySingleAwait(sql: String): JsonArray?

Execute a one shot SQL statement that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution. Only the first result from the result set is returned.

querySingleWithParamsAwait

suspend fun SQLConnection.querySingleWithParamsAwait(sql: String, arguments: JsonArray): JsonArray?

Execute a one shot SQL statement with arguments that returns a single SQL row. This method will reduce the boilerplate code by getting a connection from the pool (this object) and return it back after the execution. Only the first result from the result set is returned.

queryStreamAwait

suspend fun SQLConnection.queryStreamAwait(sql: String): SQLRowStream

Executes the given SQL SELECT statement which returns the results of the query as a read stream.

queryStreamWithParamsAwait

suspend fun SQLConnection.queryStreamWithParamsAwait(sql: String, params: JsonArray): SQLRowStream

Executes the given SQL SELECT statement which returns the results of the query as a read stream.

queryWithParamsAwait

suspend fun SQLConnection.queryWithParamsAwait(sql: String, params: JsonArray): ResultSet

Executes the given SQL SELECT prepared statement which returns the results of the query.

rollbackAwait

suspend fun SQLConnection.rollbackAwait(): Unit

Rolls back all changes made since the previous commit/rollback.

setAutoCommitAwait

suspend fun SQLConnection.setAutoCommitAwait(autoCommit: Boolean): Unit

Sets the auto commit flag for this connection. True by default.

setTransactionIsolationAwait

suspend fun SQLConnection.setTransactionIsolationAwait(isolation: TransactionIsolation): Unit

Attempts to change the transaction isolation level for this Connection object to the one given.

updateAwait

suspend fun SQLConnection.updateAwait(sql: String): UpdateResult

Executes the given SQL statement which may be an INSERT, UPDATE, or DELETE statement.

updateWithParamsAwait

suspend fun SQLConnection.updateWithParamsAwait(sql: String, params: JsonArray): UpdateResult

Executes the given prepared statement which may be an INSERT, UPDATE, or DELETE statement with the given parameters