Class SQLConnection
- All Implemented Interfaces:
MutinyDelegate,SQLOperations
original non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSQLConnection(io.vertx.ext.sql.SQLConnection delegate) SQLConnection(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionBatch simple SQL strings and execute the batch where the async result contains a array of Integers.batchAndAwait(List<String> sqlStatements) Blocking variant ofbatch(List).batchAndForget(List<String> sqlStatements) Variant ofbatch(List)that ignores the result of the operation.batchCallableWithParams(String sqlStatement, List<io.vertx.core.json.JsonArray> inArgs, List<io.vertx.core.json.JsonArray> outArgs) Batch a callable statement with all entries from the args list.batchCallableWithParamsAndAwait(String sqlStatement, List<io.vertx.core.json.JsonArray> inArgs, List<io.vertx.core.json.JsonArray> outArgs) Blocking variant ofbatchCallableWithParams(String,List,List).batchCallableWithParamsAndForget(String sqlStatement, List<io.vertx.core.json.JsonArray> inArgs, List<io.vertx.core.json.JsonArray> outArgs) Variant ofbatchCallableWithParams(String,List,List)that ignores the result of the operation.batchWithParams(String sqlStatement, List<io.vertx.core.json.JsonArray> args) Batch a prepared statement with all entries from the args list.batchWithParamsAndAwait(String sqlStatement, List<io.vertx.core.json.JsonArray> args) Blocking variant ofbatchWithParams(String,List).batchWithParamsAndForget(String sqlStatement, List<io.vertx.core.json.JsonArray> args) Variant ofbatchWithParams(String,List)that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.ext.sql.ResultSet>Calls the given SQLPROCEDUREwhich returns the result from the procedure.io.vertx.ext.sql.ResultSetcallAndAwait(String sql) Blocking variant ofcall(String).callAndForget(String sql) Variant ofcall(String)that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.ext.sql.ResultSet>callWithParams(String sql, io.vertx.core.json.JsonArray params, io.vertx.core.json.JsonArray outputs) Calls the given SQLPROCEDUREwhich returns the result from the procedure.io.vertx.ext.sql.ResultSetcallWithParamsAndAwait(String sql, io.vertx.core.json.JsonArray params, io.vertx.core.json.JsonArray outputs) Blocking variant ofcallWithParams(String,JsonArray,JsonArray).callWithParamsAndForget(String sql, io.vertx.core.json.JsonArray params, io.vertx.core.json.JsonArray outputs) Variant ofcallWithParams(String,JsonArray,JsonArray)that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>close()Closes the connection.Blocking variant ofclose().voidVariant ofclose()that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>commit()Commits all changes made since the previous commit/rollback.Blocking variant ofcommit().Variant ofcommit()that ignores the result of the operation.booleanio.smallrye.mutiny.Uni<Void>Executes the given SQL statementexecuteAndAwait(String sql) Blocking variant ofexecute(String).executeAndForget(String sql) Variant ofexecute(String)that ignores the result of the operation.io.vertx.ext.sql.SQLConnectionio.smallrye.mutiny.Uni<io.vertx.ext.sql.TransactionIsolation>Attempts to return the transaction isolation level for this Connection object to the one given.io.vertx.ext.sql.TransactionIsolationBlocking variant ofgetTransactionIsolation().Variant ofgetTransactionIsolation()that ignores the result of the operation.inthashCode()static SQLConnectionnewInstance(io.vertx.ext.sql.SQLConnection arg) io.smallrye.mutiny.Uni<io.vertx.ext.sql.ResultSet>Executes the given SQLSELECTstatement which returns the results of the query.io.vertx.ext.sql.ResultSetqueryAndAwait(String sql) Blocking variant ofquery(String).queryAndForget(String sql) Variant ofquery(String)that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray>querySingle(String sql) Execute a one shot SQL statement that returns a single SQL row.io.vertx.core.json.JsonArrayBlocking variant ofSQLOperations.querySingle(String).Variant ofSQLOperations.querySingle(String)that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray>querySingleWithParams(String sql, io.vertx.core.json.JsonArray arguments) Execute a one shot SQL statement with arguments that returns a single SQL row.io.vertx.core.json.JsonArrayquerySingleWithParamsAndAwait(String sql, io.vertx.core.json.JsonArray arguments) Blocking variant ofSQLOperations.querySingleWithParams(String,JsonArray).querySingleWithParamsAndForget(String sql, io.vertx.core.json.JsonArray arguments) Variant ofSQLOperations.querySingleWithParams(String,JsonArray)that ignores the result of the operation.io.smallrye.mutiny.Uni<SQLRowStream>queryStream(String sql) Executes the given SQLSELECTstatement which returns the results of the query as a read stream.Blocking variant ofqueryStream(String).Variant ofqueryStream(String)that ignores the result of the operation.io.smallrye.mutiny.Uni<SQLRowStream>queryStreamWithParams(String sql, io.vertx.core.json.JsonArray params) Executes the given SQLSELECTstatement which returns the results of the query as a read stream.queryStreamWithParamsAndAwait(String sql, io.vertx.core.json.JsonArray params) Blocking variant ofqueryStreamWithParams(String,JsonArray).queryStreamWithParamsAndForget(String sql, io.vertx.core.json.JsonArray params) Variant ofqueryStreamWithParams(String,JsonArray)that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.ext.sql.ResultSet>queryWithParams(String sql, io.vertx.core.json.JsonArray params) Executes the given SQLSELECTprepared statement which returns the results of the query.io.vertx.ext.sql.ResultSetqueryWithParamsAndAwait(String sql, io.vertx.core.json.JsonArray params) Blocking variant ofqueryWithParams(String,JsonArray).queryWithParamsAndForget(String sql, io.vertx.core.json.JsonArray params) Variant ofqueryWithParams(String,JsonArray)that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>rollback()Rolls back all changes made since the previous commit/rollback.Blocking variant ofrollback().Variant ofrollback()that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>setAutoCommit(boolean autoCommit) Sets the auto commit flag for this connection.setAutoCommitAndAwait(boolean autoCommit) Blocking variant ofsetAutoCommit(boolean).setAutoCommitAndForget(boolean autoCommit) Variant ofsetAutoCommit(boolean)that ignores the result of the operation.setOptions(io.vertx.ext.sql.SQLOptions options) setQueryTimeout(int timeoutInSeconds) Deprecated.io.smallrye.mutiny.Uni<Void>setTransactionIsolation(io.vertx.ext.sql.TransactionIsolation isolation) Attempts to change the transaction isolation level for this Connection object to the one given.setTransactionIsolationAndAwait(io.vertx.ext.sql.TransactionIsolation isolation) Blocking variant ofsetTransactionIsolation(TransactionIsolation).setTransactionIsolationAndForget(io.vertx.ext.sql.TransactionIsolation isolation) Variant ofsetTransactionIsolation(TransactionIsolation)that ignores the result of the operation.toString()io.smallrye.mutiny.Uni<io.vertx.ext.sql.UpdateResult>Executes the given SQL statement which may be anINSERT,UPDATE, orDELETEstatement.io.vertx.ext.sql.UpdateResultupdateAndAwait(String sql) Blocking variant ofupdate(String).updateAndForget(String sql) Variant ofupdate(String)that ignores the result of the operation.io.smallrye.mutiny.Uni<io.vertx.ext.sql.UpdateResult>updateWithParams(String sql, io.vertx.core.json.JsonArray params) Executes the given prepared statement which may be anINSERT,UPDATE, orDELETEstatement with the given parametersio.vertx.ext.sql.UpdateResultupdateWithParamsAndAwait(String sql, io.vertx.core.json.JsonArray params) Blocking variant ofupdateWithParams(String,JsonArray).updateWithParamsAndForget(String sql, io.vertx.core.json.JsonArray params) Variant ofupdateWithParams(String,JsonArray)that ignores the result of the operation.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
SQLConnection
public SQLConnection(io.vertx.ext.sql.SQLConnection delegate) -
SQLConnection
-
-
Method Details
-
getDelegate
public io.vertx.ext.sql.SQLConnection getDelegate()- Specified by:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfaceSQLOperations- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
querySingle
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray> querySingle(String sql) 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.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
querySinglein interfaceSQLOperations- Parameters:
sql- the statement to execute- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
querySingleAndAwait
Blocking variant ofSQLOperations.querySingle(String).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
querySingleAndAwaitin interfaceSQLOperations- Parameters:
sql- the statement to execute- Returns:
- the JsonArray instance produced by the operation.
-
querySingleAndForget
Variant ofSQLOperations.querySingle(String)that ignores the result of the operation.This method subscribes on the result of
SQLOperations.querySingle(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromSQLOperations.querySingle(String)but you don't need to compose it with other operations.- Specified by:
querySingleAndForgetin interfaceSQLOperations- Parameters:
sql- the statement to execute- Returns:
- the instance of SQLOperations to chain method calls.
-
querySingleWithParams
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonArray> querySingleWithParams(String sql, io.vertx.core.json.JsonArray arguments) 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.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
querySingleWithParamsin interfaceSQLOperations- Parameters:
sql- the statement to executearguments- the arguments- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
querySingleWithParamsAndAwait
public io.vertx.core.json.JsonArray querySingleWithParamsAndAwait(String sql, io.vertx.core.json.JsonArray arguments) Blocking variant ofSQLOperations.querySingleWithParams(String,JsonArray).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
querySingleWithParamsAndAwaitin interfaceSQLOperations- Parameters:
sql- the statement to executearguments- the arguments- Returns:
- the JsonArray instance produced by the operation.
-
querySingleWithParamsAndForget
public SQLOperations querySingleWithParamsAndForget(String sql, io.vertx.core.json.JsonArray arguments) Variant ofSQLOperations.querySingleWithParams(String,JsonArray)that ignores the result of the operation.This method subscribes on the result of
SQLOperations.querySingleWithParams(String,JsonArray), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromSQLOperations.querySingleWithParams(String,JsonArray)but you don't need to compose it with other operations.- Specified by:
querySingleWithParamsAndForgetin interfaceSQLOperations- Parameters:
sql- the statement to executearguments- the arguments- Returns:
- the instance of SQLOperations to chain method calls.
-
setOptions
- Parameters:
options- the options to modify the unwrapped connection.- Returns:
- the instance of SQLConnection to chain method calls.
-
setAutoCommit
Sets the auto commit flag for this connection. True by default.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
autoCommit- the autoCommit flag, true by default.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
setAutoCommitAndAwait
Blocking variant ofsetAutoCommit(boolean).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
autoCommit- the autoCommit flag, true by default.- Returns:
- the Void instance produced by the operation.
-
setAutoCommitAndForget
Variant ofsetAutoCommit(boolean)that ignores the result of the operation.This method subscribes on the result of
setAutoCommit(boolean), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsetAutoCommit(boolean)but you don't need to compose it with other operations.- Parameters:
autoCommit- the autoCommit flag, true by default.- Returns:
- the instance of SQLConnection to chain method calls.
-
execute
Executes the given SQL statementUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
sql- the SQL to execute. For exampleCREATE TABLE IF EXISTS table ...- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
executeAndAwait
Blocking variant ofexecute(String).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
sql- the SQL to execute. For exampleCREATE TABLE IF EXISTS table ...- Returns:
- the Void instance produced by the operation.
-
executeAndForget
Variant ofexecute(String)that ignores the result of the operation.This method subscribes on the result of
execute(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromexecute(String)but you don't need to compose it with other operations.- Parameters:
sql- the SQL to execute. For exampleCREATE TABLE IF EXISTS table ...- Returns:
- the instance of SQLConnection to chain method calls.
-
query
Executes the given SQLSELECTstatement which returns the results of the query.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
queryin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleSELECT * FROM table ....- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
queryAndAwait
Blocking variant ofquery(String).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
queryAndAwaitin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleSELECT * FROM table ....- Returns:
- the ResultSet instance produced by the operation.
-
queryAndForget
Variant ofquery(String)that ignores the result of the operation.This method subscribes on the result of
query(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromquery(String)but you don't need to compose it with other operations.- Specified by:
queryAndForgetin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleSELECT * FROM table ....- Returns:
- the instance of SQLConnection to chain method calls.
-
queryStream
Executes the given SQLSELECTstatement which returns the results of the query as a read stream.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
queryStreamin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleSELECT * FROM table ....- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
queryStreamAndAwait
Blocking variant ofqueryStream(String).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
queryStreamAndAwaitin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleSELECT * FROM table ....- Returns:
- the SQLRowStream instance produced by the operation.
-
queryStreamAndForget
Variant ofqueryStream(String)that ignores the result of the operation.This method subscribes on the result of
queryStream(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromqueryStream(String)but you don't need to compose it with other operations.- Specified by:
queryStreamAndForgetin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleSELECT * FROM table ....- Returns:
- the instance of SQLConnection to chain method calls.
-
queryWithParams
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.sql.ResultSet> queryWithParams(String sql, io.vertx.core.json.JsonArray params) Executes the given SQLSELECTprepared statement which returns the results of the query.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
queryWithParamsin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleSELECT * FROM table ....params- these are the parameters to fill the statement.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
queryWithParamsAndAwait
public io.vertx.ext.sql.ResultSet queryWithParamsAndAwait(String sql, io.vertx.core.json.JsonArray params) Blocking variant ofqueryWithParams(String,JsonArray).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
queryWithParamsAndAwaitin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleSELECT * FROM table ....params- these are the parameters to fill the statement.- Returns:
- the ResultSet instance produced by the operation.
-
queryWithParamsAndForget
Variant ofqueryWithParams(String,JsonArray)that ignores the result of the operation.This method subscribes on the result of
queryWithParams(String,JsonArray), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromqueryWithParams(String,JsonArray)but you don't need to compose it with other operations.- Specified by:
queryWithParamsAndForgetin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleSELECT * FROM table ....params- these are the parameters to fill the statement.- Returns:
- the instance of SQLConnection to chain method calls.
-
queryStreamWithParams
@CheckReturnValue public io.smallrye.mutiny.Uni<SQLRowStream> queryStreamWithParams(String sql, io.vertx.core.json.JsonArray params) Executes the given SQLSELECTstatement which returns the results of the query as a read stream.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
queryStreamWithParamsin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleSELECT * FROM table ....params- these are the parameters to fill the statement.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
queryStreamWithParamsAndAwait
Blocking variant ofqueryStreamWithParams(String,JsonArray).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
queryStreamWithParamsAndAwaitin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleSELECT * FROM table ....params- these are the parameters to fill the statement.- Returns:
- the SQLRowStream instance produced by the operation.
-
queryStreamWithParamsAndForget
public SQLConnection queryStreamWithParamsAndForget(String sql, io.vertx.core.json.JsonArray params) Variant ofqueryStreamWithParams(String,JsonArray)that ignores the result of the operation.This method subscribes on the result of
queryStreamWithParams(String,JsonArray), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromqueryStreamWithParams(String,JsonArray)but you don't need to compose it with other operations.- Specified by:
queryStreamWithParamsAndForgetin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleSELECT * FROM table ....params- these are the parameters to fill the statement.- Returns:
- the instance of SQLConnection to chain method calls.
-
update
Executes the given SQL statement which may be anINSERT,UPDATE, orDELETEstatement.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
updatein interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleINSERT INTO table ...- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
updateAndAwait
Blocking variant ofupdate(String).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
updateAndAwaitin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleINSERT INTO table ...- Returns:
- the UpdateResult instance produced by the operation.
-
updateAndForget
Variant ofupdate(String)that ignores the result of the operation.This method subscribes on the result of
update(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromupdate(String)but you don't need to compose it with other operations.- Specified by:
updateAndForgetin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleINSERT INTO table ...- Returns:
- the instance of SQLConnection to chain method calls.
-
updateWithParams
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.sql.UpdateResult> updateWithParams(String sql, io.vertx.core.json.JsonArray params) Executes the given prepared statement which may be anINSERT,UPDATE, orDELETEstatement with the given parametersUnlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
updateWithParamsin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleINSERT INTO table ...params- these are the parameters to fill the statement.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
updateWithParamsAndAwait
public io.vertx.ext.sql.UpdateResult updateWithParamsAndAwait(String sql, io.vertx.core.json.JsonArray params) Blocking variant ofupdateWithParams(String,JsonArray).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
updateWithParamsAndAwaitin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleINSERT INTO table ...params- these are the parameters to fill the statement.- Returns:
- the UpdateResult instance produced by the operation.
-
updateWithParamsAndForget
Variant ofupdateWithParams(String,JsonArray)that ignores the result of the operation.This method subscribes on the result of
updateWithParams(String,JsonArray), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromupdateWithParams(String,JsonArray)but you don't need to compose it with other operations.- Specified by:
updateWithParamsAndForgetin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For exampleINSERT INTO table ...params- these are the parameters to fill the statement.- Returns:
- the instance of SQLConnection to chain method calls.
-
call
Calls the given SQLPROCEDUREwhich returns the result from the procedure.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
callin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For example{call getEmpName}.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
callAndAwait
Blocking variant ofcall(String).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
callAndAwaitin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For example{call getEmpName}.- Returns:
- the ResultSet instance produced by the operation.
-
callAndForget
Variant ofcall(String)that ignores the result of the operation.This method subscribes on the result of
call(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromcall(String)but you don't need to compose it with other operations.- Specified by:
callAndForgetin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For example{call getEmpName}.- Returns:
- the instance of SQLConnection to chain method calls.
-
callWithParams
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.sql.ResultSet> callWithParams(String sql, io.vertx.core.json.JsonArray params, io.vertx.core.json.JsonArray outputs) Calls the given SQLPROCEDUREwhich returns the result from the procedure. The index of params and outputs are important for both arrays, for example when dealing with a prodecure that takes the first 2 arguments as input values and the 3 arg as an output then the arrays should be like:params = [VALUE1, VALUE2, null] outputs = [null, null, "VARCHAR"]
Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Specified by:
callWithParamsin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For example{call getEmpName (?, ?)}.params- these are the parameters to fill the statement.outputs- these are the outputs to fill the statement.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
callWithParamsAndAwait
public io.vertx.ext.sql.ResultSet callWithParamsAndAwait(String sql, io.vertx.core.json.JsonArray params, io.vertx.core.json.JsonArray outputs) Blocking variant ofcallWithParams(String,JsonArray,JsonArray).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Specified by:
callWithParamsAndAwaitin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For example{call getEmpName (?, ?)}.params- these are the parameters to fill the statement.outputs- these are the outputs to fill the statement.- Returns:
- the ResultSet instance produced by the operation.
-
callWithParamsAndForget
public SQLConnection callWithParamsAndForget(String sql, io.vertx.core.json.JsonArray params, io.vertx.core.json.JsonArray outputs) Variant ofcallWithParams(String,JsonArray,JsonArray)that ignores the result of the operation.This method subscribes on the result of
callWithParams(String,JsonArray,JsonArray), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromcallWithParams(String,JsonArray,JsonArray)but you don't need to compose it with other operations.- Specified by:
callWithParamsAndForgetin interfaceSQLOperations- Parameters:
sql- the SQL to execute. For example{call getEmpName (?, ?)}.params- these are the parameters to fill the statement.outputs- these are the outputs to fill the statement.- Returns:
- the instance of SQLConnection to chain method calls.
-
close
Closes the connection. Important to always close the connection when you are done so it's returned to the pool.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
closeAndAwait
Blocking variant ofclose().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
closeAndForget
public void closeAndForget() -
commit
Commits all changes made since the previous commit/rollback.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
commitAndAwait
Blocking variant ofcommit().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
commitAndForget
Variant ofcommit()that ignores the result of the operation.This method subscribes on the result of
commit(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromcommit()but you don't need to compose it with other operations.- Returns:
- the instance of SQLConnection to chain method calls.
-
rollback
Rolls back all changes made since the previous commit/rollback.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
rollbackAndAwait
Blocking variant ofrollback().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
rollbackAndForget
Variant ofrollback()that ignores the result of the operation.This method subscribes on the result of
rollback(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromrollback()but you don't need to compose it with other operations.- Returns:
- the instance of SQLConnection to chain method calls.
-
setQueryTimeout
Deprecated.instead usesetOptions(SQLOptions)withSQLOptions.setQueryTimeout(int)- Parameters:
timeoutInSeconds- the max amount of seconds the query can take to execute.- Returns:
- the instance of SQLConnection to chain method calls.
-
batch
Batch simple SQL strings and execute the batch where the async result contains a array of Integers.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
sqlStatements- sql statement- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
batchAndAwait
Blocking variant ofbatch(List).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
sqlStatements- sql statement- Returns:
- the List
instance produced by the operation.
-
batchAndForget
Variant ofbatch(List)that ignores the result of the operation.This method subscribes on the result of
batch(List), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frombatch(List)but you don't need to compose it with other operations.- Parameters:
sqlStatements- sql statement- Returns:
- the instance of SQLConnection to chain method calls.
-
batchWithParams
@CheckReturnValue public io.smallrye.mutiny.Uni<List<Integer>> batchWithParams(String sqlStatement, List<io.vertx.core.json.JsonArray> args) 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.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
sqlStatement- sql statementargs- the prepared statement arguments- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
batchWithParamsAndAwait
public List<Integer> batchWithParamsAndAwait(String sqlStatement, List<io.vertx.core.json.JsonArray> args) Blocking variant ofbatchWithParams(String,List).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
sqlStatement- sql statementargs- the prepared statement arguments- Returns:
- the List
instance produced by the operation.
-
batchWithParamsAndForget
public SQLConnection batchWithParamsAndForget(String sqlStatement, List<io.vertx.core.json.JsonArray> args) Variant ofbatchWithParams(String,List)that ignores the result of the operation.This method subscribes on the result of
batchWithParams(String,List), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frombatchWithParams(String,List)but you don't need to compose it with other operations.- Parameters:
sqlStatement- sql statementargs- the prepared statement arguments- Returns:
- the instance of SQLConnection to chain method calls.
-
batchCallableWithParams
@CheckReturnValue public io.smallrye.mutiny.Uni<List<Integer>> batchCallableWithParams(String sqlStatement, List<io.vertx.core.json.JsonArray> inArgs, List<io.vertx.core.json.JsonArray> outArgs) 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.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
sqlStatement- sql statementinArgs- the callable statement input argumentsoutArgs- the callable statement output arguments- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
batchCallableWithParamsAndAwait
public List<Integer> batchCallableWithParamsAndAwait(String sqlStatement, List<io.vertx.core.json.JsonArray> inArgs, List<io.vertx.core.json.JsonArray> outArgs) Blocking variant ofbatchCallableWithParams(String,List,List).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
sqlStatement- sql statementinArgs- the callable statement input argumentsoutArgs- the callable statement output arguments- Returns:
- the List
instance produced by the operation.
-
batchCallableWithParamsAndForget
public SQLConnection batchCallableWithParamsAndForget(String sqlStatement, List<io.vertx.core.json.JsonArray> inArgs, List<io.vertx.core.json.JsonArray> outArgs) Variant ofbatchCallableWithParams(String,List,List)that ignores the result of the operation.This method subscribes on the result of
batchCallableWithParams(String,List,List), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frombatchCallableWithParams(String,List,List)but you don't need to compose it with other operations.- Parameters:
sqlStatement- sql statementinArgs- the callable statement input argumentsoutArgs- the callable statement output arguments- Returns:
- the instance of SQLConnection to chain method calls.
-
setTransactionIsolation
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> setTransactionIsolation(io.vertx.ext.sql.TransactionIsolation isolation) Attempts to change the transaction isolation level for this Connection object to the one given. The constants defined in the interface Connection are the possible transaction isolation levels.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
isolation- the level of isolation- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
setTransactionIsolationAndAwait
Blocking variant ofsetTransactionIsolation(TransactionIsolation).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
isolation- the level of isolation- Returns:
- the Void instance produced by the operation.
-
setTransactionIsolationAndForget
public SQLConnection setTransactionIsolationAndForget(io.vertx.ext.sql.TransactionIsolation isolation) Variant ofsetTransactionIsolation(TransactionIsolation)that ignores the result of the operation.This method subscribes on the result of
setTransactionIsolation(TransactionIsolation), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsetTransactionIsolation(TransactionIsolation)but you don't need to compose it with other operations.- Parameters:
isolation- the level of isolation- Returns:
- the instance of SQLConnection to chain method calls.
-
getTransactionIsolation
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.sql.TransactionIsolation> getTransactionIsolation()Attempts to return the transaction isolation level for this Connection object to the one given.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
getTransactionIsolationAndAwait
public io.vertx.ext.sql.TransactionIsolation getTransactionIsolationAndAwait()Blocking variant ofgetTransactionIsolation().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the TransactionIsolation instance produced by the operation.
-
getTransactionIsolationAndForget
Variant ofgetTransactionIsolation()that ignores the result of the operation.This method subscribes on the result of
getTransactionIsolation(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromgetTransactionIsolation()but you don't need to compose it with other operations.- Returns:
- the instance of SQLConnection to chain method calls.
-
newInstance
-
setOptions(SQLOptions)withSQLOptions.setQueryTimeout(int)