Modifier and Type | Field and Description |
---|---|
static TypeArg<Pool> |
__TYPE_ARG |
Constructor and Description |
---|
Pool(Object delegate) |
Pool(io.vertx.sqlclient.Pool delegate) |
Modifier and Type | Method and Description |
---|---|
io.reactivex.rxjava3.core.Completable |
close()
Close the pool and release the associated resources.
|
boolean |
equals(Object o) |
io.reactivex.rxjava3.core.Single<SqlConnection> |
getConnection()
Get a connection from the pool.
|
io.vertx.sqlclient.Pool |
getDelegate() |
int |
hashCode() |
static Pool |
newInstance(io.vertx.sqlclient.Pool arg) |
static Pool |
pool(io.vertx.sqlclient.SqlConnectOptions connectOptions)
Create a connection pool to the database configured with the given
connectOptions and default PoolOptions |
static Pool |
pool(io.vertx.sqlclient.SqlConnectOptions connectOptions,
io.vertx.sqlclient.PoolOptions poolOptions)
Create a connection pool to the database configured with the given
connectOptions and poolOptions . |
static Pool |
pool(Vertx vertx,
io.vertx.sqlclient.SqlConnectOptions connectOptions,
io.vertx.sqlclient.PoolOptions poolOptions)
Create a connection pool to the database configured with the given
connectOptions and poolOptions . |
PreparedQuery<RowSet<Row>> |
preparedQuery(String sql)
A connection is borrowed from the connection pool when the query is executed and then immediately returned
to the pool after it completes.
|
Query<RowSet<Row>> |
query(String sql)
A connection is borrowed from the connection pool when the query is executed and then immediately returned
to the pool after it completes.
|
io.reactivex.rxjava3.core.Completable |
rxClose()
Close the pool and release the associated resources.
|
io.reactivex.rxjava3.core.Single<SqlConnection> |
rxGetConnection()
Get a connection from the pool.
|
<T> io.reactivex.rxjava3.core.Maybe<T> |
rxWithConnection(Function<SqlConnection,io.reactivex.rxjava3.core.Maybe<T>> function)
Get a connection from the pool and execute the given
function . |
<T> io.reactivex.rxjava3.core.Maybe<T> |
rxWithTransaction(Function<SqlConnection,io.reactivex.rxjava3.core.Maybe<T>> function)
Execute the given
function within a transaction. |
String |
toString() |
<T> io.reactivex.rxjava3.core.Maybe<T> |
withConnection(Function<SqlConnection,io.reactivex.rxjava3.core.Maybe<T>> function)
Get a connection from the pool and execute the given
function . |
<T> io.reactivex.rxjava3.core.Maybe<T> |
withTransaction(Function<SqlConnection,io.reactivex.rxjava3.core.Maybe<T>> function)
Execute the given
function within a transaction. |
newInstance
public Pool(io.vertx.sqlclient.Pool delegate)
public Pool(Object delegate)
public io.vertx.sqlclient.Pool getDelegate()
getDelegate
in class SqlClient
public static Pool pool(io.vertx.sqlclient.SqlConnectOptions connectOptions)
connectOptions
and default PoolOptions
connectOptions
- the options used to create the connection pool, such as database hostnamepublic static Pool pool(io.vertx.sqlclient.SqlConnectOptions connectOptions, io.vertx.sqlclient.PoolOptions poolOptions)
connectOptions
and poolOptions
.connectOptions
- the options used to create the connection pool, such as database hostnamepoolOptions
- the options for creating the poolpublic static Pool pool(Vertx vertx, io.vertx.sqlclient.SqlConnectOptions connectOptions, io.vertx.sqlclient.PoolOptions poolOptions)
connectOptions
and poolOptions
.vertx
- the Vertx instance to be used with the connection poolconnectOptions
- the options used to create the connection pool, such as database hostnamepoolOptions
- the options for creating the poolpublic io.reactivex.rxjava3.core.Single<SqlConnection> getConnection()
public io.reactivex.rxjava3.core.Single<SqlConnection> rxGetConnection()
public Query<RowSet<Row>> query(String sql)
public PreparedQuery<RowSet<Row>> preparedQuery(String sql)
preparedQuery
in class SqlClient
sql
- public <T> io.reactivex.rxjava3.core.Maybe<T> withTransaction(Function<SqlConnection,io.reactivex.rxjava3.core.Maybe<T>> function)
function
within a transaction.
The function
is passed a client executing all operations within a transaction.
When the future returned by the function
The handler
is given a success result when the function returns a succeeded futures and the transaction commits.
Otherwise it is given a failure result.
function
- the code to executepublic <T> io.reactivex.rxjava3.core.Maybe<T> rxWithTransaction(Function<SqlConnection,io.reactivex.rxjava3.core.Maybe<T>> function)
function
within a transaction.
The function
is passed a client executing all operations within a transaction.
When the future returned by the function
The handler
is given a success result when the function returns a succeeded futures and the transaction commits.
Otherwise it is given a failure result.
function
- the code to executepublic <T> io.reactivex.rxjava3.core.Maybe<T> withConnection(Function<SqlConnection,io.reactivex.rxjava3.core.Maybe<T>> function)
function
.
When the future returned by the function
completes, the connection is returned to the pool.
The handler
is given a success result when the function returns a succeeded futures.
Otherwise it is given a failure result.
function
- the code to executepublic <T> io.reactivex.rxjava3.core.Maybe<T> rxWithConnection(Function<SqlConnection,io.reactivex.rxjava3.core.Maybe<T>> function)
function
.
When the future returned by the function
completes, the connection is returned to the pool.
The handler
is given a success result when the function returns a succeeded futures.
Otherwise it is given a failure result.
function
- the code to executepublic io.reactivex.rxjava3.core.Completable close()
public io.reactivex.rxjava3.core.Completable rxClose()
public static Pool newInstance(io.vertx.sqlclient.Pool arg)
Copyright © 2021 Eclipse. All rights reserved.