Class SQLConnection
- java.lang.Object
-
- io.vertx.mutiny.ext.sql.SQLConnection
-
- All Implemented Interfaces:
SQLOperations
public class SQLConnection extends Object implements SQLOperations
Represents a connection to a SQL database NOTE: This class has been automatically generated from theoriginalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<SQLConnection>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description SQLConnection(io.vertx.ext.sql.SQLConnection delegate)SQLConnection(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<List<Integer>>batch(List<String> sqlStatements)Batch simple SQL strings and execute the batch where the async result contains a array of Integers.List<Integer>batchAndAwait(List<String> sqlStatements)Blocking variant ofbatch(List).SQLConnectionbatchAndForget(List<String> sqlStatements)Variant ofbatch(List)that ignores the result of the operation.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.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).SQLConnectionbatchCallableWithParamsAndForget(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.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.List<Integer>batchWithParamsAndAwait(String sqlStatement, List<io.vertx.core.json.JsonArray> args)Blocking variant ofbatchWithParams(String,List).SQLConnectionbatchWithParamsAndForget(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>call(String sql)Calls the given SQLPROCEDUREwhich returns the result from the procedure.io.vertx.ext.sql.ResultSetcallAndAwait(String sql)Blocking variant ofcall(String).SQLConnectioncallAndForget(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).SQLConnectioncallWithParamsAndForget(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.VoidcloseAndAwait()Blocking variant ofclose().voidcloseAndForget()Variant ofclose()that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>commit()Commits all changes made since the previous commit/rollback.VoidcommitAndAwait()Blocking variant ofcommit().SQLConnectioncommitAndForget()Variant ofcommit()that ignores the result of the operation.booleanequals(Object o)io.smallrye.mutiny.Uni<Void>execute(String sql)Executes the given SQL statementVoidexecuteAndAwait(String sql)Blocking variant ofexecute(String).SQLConnectionexecuteAndForget(String sql)Variant ofexecute(String)that ignores the result of the operation.io.vertx.ext.sql.SQLConnectiongetDelegate()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.io.vertx.ext.sql.TransactionIsolationgetTransactionIsolationAndAwait()Blocking variant ofgetTransactionIsolation().SQLConnectiongetTransactionIsolationAndForget()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>query(String sql)Executes the given SQLSELECTstatement which returns the results of the query.io.vertx.ext.sql.ResultSetqueryAndAwait(String sql)Blocking variant ofquery(String).SQLConnectionqueryAndForget(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.JsonArrayquerySingleAndAwait(String sql)Blocking variant ofSQLOperations.querySingle(String).SQLOperationsquerySingleAndForget(String sql)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).SQLOperationsquerySingleWithParamsAndForget(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.SQLRowStreamqueryStreamAndAwait(String sql)Blocking variant ofqueryStream(String).SQLConnectionqueryStreamAndForget(String sql)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.SQLRowStreamqueryStreamWithParamsAndAwait(String sql, io.vertx.core.json.JsonArray params)Blocking variant ofqueryStreamWithParams(String,JsonArray).SQLConnectionqueryStreamWithParamsAndForget(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).SQLConnectionqueryWithParamsAndForget(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.VoidrollbackAndAwait()Blocking variant ofrollback().SQLConnectionrollbackAndForget()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.VoidsetAutoCommitAndAwait(boolean autoCommit)Blocking variant ofsetAutoCommit(boolean).SQLConnectionsetAutoCommitAndForget(boolean autoCommit)Variant ofsetAutoCommit(boolean)that ignores the result of the operation.SQLConnectionsetOptions(io.vertx.ext.sql.SQLOptions options)SQLConnectionsetQueryTimeout(int timeoutInSeconds)Deprecated.instead usesetOptions(SQLOptions)withSQLOptions.setQueryTimeout(int)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.VoidsetTransactionIsolationAndAwait(io.vertx.ext.sql.TransactionIsolation isolation)Blocking variant ofsetTransactionIsolation(TransactionIsolation).SQLConnectionsetTransactionIsolationAndForget(io.vertx.ext.sql.TransactionIsolation isolation)Variant ofsetTransactionIsolation(TransactionIsolation)that ignores the result of the operation.StringtoString()io.smallrye.mutiny.Uni<io.vertx.ext.sql.UpdateResult>update(String sql)Executes the given SQL statement which may be anINSERT,UPDATE, orDELETEstatement.io.vertx.ext.sql.UpdateResultupdateAndAwait(String sql)Blocking variant ofupdate(String).SQLConnectionupdateAndForget(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).SQLConnectionupdateWithParamsAndForget(String sql, io.vertx.core.json.JsonArray params)Variant ofupdateWithParams(String,JsonArray)that ignores the result of the operation.
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<SQLConnection> __TYPE_ARG
-
-
Constructor Detail
-
SQLConnection
public SQLConnection(io.vertx.ext.sql.SQLConnection delegate)
-
SQLConnection
public SQLConnection(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.sql.SQLConnection getDelegate()
- Specified by:
getDelegatein interfaceSQLOperations
-
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
public io.vertx.core.json.JsonArray querySingleAndAwait(String sql)
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
public SQLOperations querySingleAndForget(String sql)
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
public SQLConnection setOptions(io.vertx.ext.sql.SQLOptions options)
- Parameters:
options- the options to modify the unwrapped connection.- Returns:
- the instance of SQLConnection to chain method calls.
-
setAutoCommit
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> setAutoCommit(boolean autoCommit)
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
public Void setAutoCommitAndAwait(boolean autoCommit)
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
public SQLConnection setAutoCommitAndForget(boolean autoCommit)
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
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> execute(String sql)
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
public Void executeAndAwait(String sql)
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
public SQLConnection executeAndForget(String sql)
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
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.sql.ResultSet> query(String sql)
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
public io.vertx.ext.sql.ResultSet queryAndAwait(String sql)
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
public SQLConnection queryAndForget(String sql)
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
@CheckReturnValue public io.smallrye.mutiny.Uni<SQLRowStream> queryStream(String sql)
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
public SQLRowStream queryStreamAndAwait(String sql)
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
public SQLConnection queryStreamAndForget(String sql)
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
public SQLConnection queryWithParamsAndForget(String sql, io.vertx.core.json.JsonArray params)
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
public SQLRowStream queryStreamWithParamsAndAwait(String sql, io.vertx.core.json.JsonArray params)
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
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.sql.UpdateResult> update(String sql)
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
public io.vertx.ext.sql.UpdateResult updateAndAwait(String sql)
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
public SQLConnection updateAndForget(String sql)
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
public SQLConnection updateWithParamsAndForget(String sql, io.vertx.core.json.JsonArray params)
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
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.sql.ResultSet> call(String sql)
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
public io.vertx.ext.sql.ResultSet callAndAwait(String sql)
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
public SQLConnection callAndForget(String sql)
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
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> 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
public Void 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
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> 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
public Void 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
public SQLConnection 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
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> 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
public Void 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
public SQLConnection 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 public SQLConnection setQueryTimeout(int timeoutInSeconds)
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
@CheckReturnValue public io.smallrye.mutiny.Uni<List<Integer>> batch(List<String> sqlStatements)
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
public List<Integer> batchAndAwait(List<String> sqlStatements)
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
public SQLConnection batchAndForget(List<String> sqlStatements)
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
public Void setTransactionIsolationAndAwait(io.vertx.ext.sql.TransactionIsolation isolation)
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
public SQLConnection 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
public static SQLConnection newInstance(io.vertx.ext.sql.SQLConnection arg)
-
-