Class JDBCClient
- All Implemented Interfaces:
MutinyDelegate
,SQLOperations
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeArg<JDBCClient>
static final String
The name of the default data sourcestatic final String
The default data source provider for this pool, loaded from JVM system properties with the key. -
Constructor Summary
ConstructorsConstructorDescriptionJDBCClient
(io.vertx.ext.jdbc.JDBCClient delegate) JDBCClient
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionstatic JDBCClient
static JDBCClient
createShared
(Vertx vertx, io.vertx.core.json.JsonObject config) static JDBCClient
createShared
(Vertx vertx, io.vertx.core.json.JsonObject config, String dataSourceName) boolean
io.vertx.ext.jdbc.JDBCClient
int
hashCode()
static JDBCClient
newInstance
(io.vertx.ext.jdbc.JDBCClient arg) 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.JsonArray
Blocking 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.JsonArray
querySingleWithParamsAndAwait
(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.toString()
Methods inherited from class io.vertx.mutiny.ext.sql.SQLClient
call, callAndAwait, callAndForget, callWithParams, callWithParamsAndAwait, callWithParamsAndForget, close, closeAndAwait, closeAndForget, getConnection, getConnectionAndAwait, getConnectionAndForget, newInstance, query, queryAndAwait, queryAndForget, queryStream, queryStreamAndAwait, queryStreamAndForget, queryStreamWithParams, queryStreamWithParamsAndAwait, queryStreamWithParamsAndForget, queryWithParams, queryWithParamsAndAwait, queryWithParamsAndForget, update, updateAndAwait, updateAndForget, updateWithParams, updateWithParamsAndAwait, updateWithParamsAndForget
-
Field Details
-
__TYPE_ARG
-
DEFAULT_PROVIDER_CLASS
The default data source provider for this pool, loaded from JVM system properties with the key. The value can be one of:- C3P0:
- Hikari:
- Agroal:
-
DEFAULT_DS_NAME
The name of the default data source- See Also:
-
-
Constructor Details
-
JDBCClient
public JDBCClient(io.vertx.ext.jdbc.JDBCClient delegate) -
JDBCClient
-
-
Method Details
-
getDelegate
public io.vertx.ext.jdbc.JDBCClient getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Specified by:
getDelegate
in interfaceSQLOperations
- Overrides:
getDelegate
in classSQLClient
- 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:
querySingle
in interfaceSQLOperations
- Overrides:
querySingle
in classSQLClient
- Parameters:
sql
- the statement to execute- Returns:
- the
uni
firing 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:
querySingleAndAwait
in interfaceSQLOperations
- Overrides:
querySingleAndAwait
in classSQLClient
- 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:
querySingleAndForget
in interfaceSQLOperations
- Overrides:
querySingleAndForget
in classSQLClient
- 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:
querySingleWithParams
in interfaceSQLOperations
- Overrides:
querySingleWithParams
in classSQLClient
- Parameters:
sql
- the statement to executearguments
- the arguments- Returns:
- the
uni
firing 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:
querySingleWithParamsAndAwait
in interfaceSQLOperations
- Overrides:
querySingleWithParamsAndAwait
in classSQLClient
- 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:
querySingleWithParamsAndForget
in interfaceSQLOperations
- Overrides:
querySingleWithParamsAndForget
in classSQLClient
- Parameters:
sql
- the statement to executearguments
- the arguments- Returns:
- the instance of SQLOperations to chain method calls.
-
create
- Parameters:
vertx
- the Vert.x instanceconfig
- the configuration- Returns:
- the client
-
newInstance
-