vertx / io.vertx.kotlin.ext.sql / io.vertx.ext.sql.SQLClient

Extensions for io.vertx.ext.sql.SQLClient

callAwait

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

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

callWithParamsAwait

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

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

closeAwait

suspend fun SQLClient.closeAwait(): Unit

Close the client and release all resources. Call the handler when close is complete.

getConnectionAwait

suspend fun SQLClient.getConnectionAwait(): SQLConnection

Returns a connection that can be used to perform SQL operations on. It's important to remember to close the connection when you are done, so it is returned to the pool.

queryAwait

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

Execute a single SQL statement, this method acquires a connection from the the pool and executes the SQL statement and returns it back after the execution.

querySingleAwait

suspend fun SQLClient.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 SQLClient.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 SQLClient.queryStreamAwait(sql: String): SQLRowStream

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

queryStreamWithParamsAwait

suspend fun SQLClient.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 SQLClient.queryWithParamsAwait(sql: String, arguments: JsonArray): ResultSet

Execute a single SQL prepared statement, this method acquires a connection from the the pool and executes the SQL prepared statement and returns it back after the execution.

updateAwait

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

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

updateWithParamsAwait

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

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