public class PgPool extends Pool
PostgreSQL connections
.
NOTE: This class has been automatically generated from the original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<PgPool> |
__TYPE_ARG |
Constructor and Description |
---|
PgPool(Object delegate) |
PgPool(PgPool delegate) |
Modifier and Type | Method and Description |
---|---|
static SqlClient |
client()
Like
client() with default options. |
static SqlClient |
client(List<PgConnectOptions> databases,
PoolOptions options)
Create a client backed by a connection pool to the PostgreSQL
databases with round-robin selection. |
static SqlClient |
client(PgConnectOptions database,
PoolOptions options)
Create a client backed by a connection pool to the PostgreSQL
database configured with the given options . |
static SqlClient |
client(PoolOptions options)
Like
client() with database retrieved from the environment variables. |
static SqlClient |
client(String connectionUri)
Like
pool() with default options. |
static SqlClient |
client(String connectionUri,
PoolOptions options)
|
static SqlClient |
client(Vertx vertx,
List<PgConnectOptions> databases,
PoolOptions options)
Like
client() with a specific instance. |
static SqlClient |
client(Vertx vertx,
PgConnectOptions database,
PoolOptions options)
Like
client() with a specific instance. |
static SqlClient |
client(Vertx vertx,
PoolOptions poolOptions)
Like
client() with database retrieved from the environment variables. |
static SqlClient |
client(Vertx vertx,
String connectionUri)
Like
client() with default options. |
static SqlClient |
client(Vertx vertx,
String connectionUri,
PoolOptions options)
|
PgPool |
connectHandler(Handler<SqlConnection> handler)
Set an handler called when the pool has established a connection to the database.
|
PgPool |
connectionProvider(java.util.function.Function<Context,Single<SqlConnection>> provider)
Replace the default pool connection provider, the new
provider returns a future connection for a
given . |
boolean |
equals(Object o) |
PgPool |
getDelegate() |
int |
hashCode() |
static PgPool |
newInstance(PgPool arg) |
static PgPool |
pool()
Like
pool() with a default poolOptions . |
static PgPool |
pool(List<PgConnectOptions> databases,
PoolOptions poolOptions)
Create a connection pool to the PostgreSQL
databases with round-robin selection. |
static PgPool |
pool(PgConnectOptions database,
PoolOptions options)
Create a connection pool to the PostgreSQL
database configured with the given options . |
static PgPool |
pool(PoolOptions options)
Like
pool() with connectOptions build from the environment variables. |
static PgPool |
pool(String connectionUri)
Like
pool() with a default poolOptions . |
static PgPool |
pool(String connectionUri,
PoolOptions options)
|
static PgPool |
pool(Vertx vertx,
List<PgConnectOptions> databases,
PoolOptions poolOptions)
Like
pool() with a specific instance. |
static PgPool |
pool(Vertx vertx,
PgConnectOptions database,
PoolOptions options)
Like
pool() with a specific instance. |
static PgPool |
pool(Vertx vertx,
PoolOptions options)
Like
pool() with the database retrieved from the environment variables. |
static PgPool |
pool(Vertx vertx,
String connectionUri)
Like
pool() with default options. |
static PgPool |
pool(Vertx vertx,
String connectionUri,
PoolOptions poolOptions)
|
String |
toString() |
close, getConnection, newInstance, pool, pool, pool, preparedQuery, query, rxClose, rxGetConnection, rxWithConnection, rxWithTransaction, size, withConnection, withTransaction
newInstance
public static final io.vertx.lang.rx.TypeArg<PgPool> __TYPE_ARG
public PgPool getDelegate()
getDelegate
in class Pool
public static PgPool pool(PoolOptions options)
pool()
with connectOptions
build from the environment variables.options
- public static PgPool pool(String connectionUri)
pool()
with a default poolOptions
.connectionUri
- public static PgPool pool(String connectionUri, PoolOptions options)
connectionUri
- options
- public static PgPool pool(Vertx vertx, String connectionUri)
pool()
with default options.vertx
- connectionUri
- public static PgPool pool(Vertx vertx, PoolOptions options)
pool()
with the database
retrieved from the environment variables.vertx
- options
- public static PgPool pool(Vertx vertx, String connectionUri, PoolOptions poolOptions)
vertx
- connectionUri
- poolOptions
- public static PgPool pool(PgConnectOptions database, PoolOptions options)
database
configured with the given options
.database
- the databaseoptions
- the options for creating the poolpublic static PgPool pool(Vertx vertx, PgConnectOptions database, PoolOptions options)
pool()
with a specific instance.vertx
- database
- options
- public static PgPool pool(List<PgConnectOptions> databases, PoolOptions poolOptions)
databases
with round-robin selection.
Round-robin is applied when a new connection is created by the pool.databases
- the list of databasespoolOptions
- the options for creating the poolpublic static PgPool pool(Vertx vertx, List<PgConnectOptions> databases, PoolOptions poolOptions)
pool()
with a specific instance.vertx
- databases
- poolOptions
- public static SqlClient client(PoolOptions options)
client()
with database
retrieved from the environment variables.options
- public static SqlClient client(String connectionUri)
pool()
with default options.connectionUri
- public static SqlClient client(String connectionUri, PoolOptions options)
connectionUri
- options
- public static SqlClient client(Vertx vertx, String connectionUri)
client()
with default options.vertx
- connectionUri
- public static SqlClient client(Vertx vertx, PoolOptions poolOptions)
client()
with database
retrieved from the environment variables.vertx
- poolOptions
- public static SqlClient client(Vertx vertx, String connectionUri, PoolOptions options)
vertx
- connectionUri
- options
- public static SqlClient client(PgConnectOptions database, PoolOptions options)
database
configured with the given options
.database
- options
- the options for creating the backing poolpublic static SqlClient client(Vertx vertx, PgConnectOptions database, PoolOptions options)
client()
with a specific instance.vertx
- database
- options
- public static SqlClient client(Vertx vertx, List<PgConnectOptions> databases, PoolOptions options)
client()
with a specific instance.vertx
- databases
- options
- public static SqlClient client(List<PgConnectOptions> databases, PoolOptions options)
databases
with round-robin selection.
Round-robin is applied when a new connection is created by the pool.databases
- the list of databasesoptions
- the options for creating the poolpublic PgPool connectHandler(Handler<SqlConnection> handler)
Pool
This handler allows interactions with the database before the connection is added to the pool.
When the handler has finished, it must call SqlClient.close()
to release the connection
to the pool.
connectHandler
in class Pool
handler
- the handlerpublic PgPool connectionProvider(java.util.function.Function<Context,Single<SqlConnection>> provider)
Pool
provider
returns a future connection for a
given .
A ConnectionFactory
can be used as connection provider.
connectionProvider
in class Pool
provider
- the new connection providerCopyright © 2021 Eclipse. All rights reserved.