Package io.vertx.reactivex.pgclient
Class PgPool
- java.lang.Object
-
- io.vertx.reactivex.sqlclient.SqlClient
-
- io.vertx.reactivex.sqlclient.Pool
-
- io.vertx.reactivex.pgclient.PgPool
-
public class PgPool extends Pool
A ofPostgreSQL connections
. NOTE: This class has been automatically generated from theoriginal
non RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<PgPool>
__TYPE_ARG
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SqlClient
client()
Likeclient()
with default options.static SqlClient
client(PgConnectOptions database, PoolOptions options)
Create a client backed by a connection pool to the PostgreSQLdatabase
configured with the givenoptions
.static SqlClient
client(Vertx vertx, PgConnectOptions database, PoolOptions options)
Likeclient()
with a specific instance.static SqlClient
client(Vertx vertx, PoolOptions poolOptions)
Likeclient()
withdatabase
retrieved from the environment variables.static SqlClient
client(Vertx vertx, String connectionUri)
Likeclient()
with default options.static SqlClient
client(Vertx vertx, String connectionUri, PoolOptions options)
static SqlClient
client(Vertx vertx, Supplier<Future<PgConnectOptions>> databases, PoolOptions options)
Likeclient()
with a specific instance.static SqlClient
client(Vertx vertx, List<PgConnectOptions> databases, PoolOptions options)
Likeclient()
with a specific instance.static SqlClient
client(PoolOptions options)
Likeclient()
withdatabase
retrieved from the environment variables.static SqlClient
client(String connectionUri)
Likepool()
with default options.static SqlClient
client(String connectionUri, PoolOptions options)
static SqlClient
client(Supplier<Future<PgConnectOptions>> databases, PoolOptions options)
Create a client backed by a connection pool to the PostgreSQLdatabases
.static SqlClient
client(List<PgConnectOptions> databases, PoolOptions options)
Create a client backed by a connection pool to the PostgreSQLdatabases
with round-robin selection.PgPool
connectHandler(Handler<SqlConnection> handler)
Set an handler called when the pool has established a connection to the database.PgPool
connectionProvider(io.reactivex.functions.Function<Context,io.reactivex.Single<SqlConnection>> provider)
Replace the default pool connection provider, the newprovider
returns a future connection for a given .PgPool
connectionProvider(Function<Context,Future<SqlConnection>> provider)
Replace the default pool connection provider, the newprovider
returns a future connection for a given .boolean
equals(Object o)
PgPool
getDelegate()
int
hashCode()
static PgPool
newInstance(PgPool arg)
static PgPool
pool()
Likepool()
with a defaultpoolOptions
.static PgPool
pool(PgConnectOptions database, PoolOptions options)
Create a connection pool to the PostgreSQLdatabase
configured with the givenoptions
.static PgPool
pool(Vertx vertx, PgConnectOptions database, PoolOptions options)
Likepool()
with a specific instance.static PgPool
pool(Vertx vertx, PoolOptions options)
Likepool()
with thedatabase
retrieved from the environment variables.static PgPool
pool(Vertx vertx, String connectionUri)
Likepool()
with default options.static PgPool
pool(Vertx vertx, String connectionUri, PoolOptions poolOptions)
static PgPool
pool(Vertx vertx, Supplier<Future<PgConnectOptions>> databases, PoolOptions poolOptions)
Likepool()
with a specific instance.static PgPool
pool(Vertx vertx, List<PgConnectOptions> databases, PoolOptions poolOptions)
Likepool()
with a specific instance.static PgPool
pool(PoolOptions options)
Likepool()
withconnectOptions
build from the environment variables.static PgPool
pool(String connectionUri)
Likepool()
with a defaultpoolOptions
.static PgPool
pool(String connectionUri, PoolOptions options)
static PgPool
pool(Supplier<Future<PgConnectOptions>> databases, PoolOptions poolOptions)
Create a connection pool to the PostgreSQLdatabases
.static PgPool
pool(List<PgConnectOptions> databases, PoolOptions poolOptions)
Create a connection pool to the PostgreSQLdatabases
with round-robin selection.String
toString()
-
Methods inherited from class io.vertx.reactivex.sqlclient.Pool
close, close, getConnection, getConnection, newInstance, pool, pool, pool, preparedQuery, query, rxClose, rxGetConnection, rxWithConnection, rxWithConnection, rxWithTransaction, rxWithTransaction, rxWithTransaction, rxWithTransaction, size, withConnection, withConnection, withConnection, withConnection, withTransaction, withTransaction, withTransaction, withTransaction, withTransaction, withTransaction, withTransaction, withTransaction
-
Methods inherited from class io.vertx.reactivex.sqlclient.SqlClient
newInstance, preparedQuery
-
-
-
-
Method Detail
-
getDelegate
public PgPool getDelegate()
- Overrides:
getDelegate
in classPool
-
pool
public static PgPool pool(PoolOptions options)
Likepool()
withconnectOptions
build from the environment variables.- Parameters:
options
-- Returns:
-
pool
public static PgPool pool(String connectionUri)
Likepool()
with a defaultpoolOptions
.- Parameters:
connectionUri
-- Returns:
-
pool
public static PgPool pool(String connectionUri, PoolOptions options)
- Parameters:
connectionUri
-options
-- Returns:
-
pool
public static PgPool pool(Vertx vertx, String connectionUri)
Likepool()
with default options.- Parameters:
vertx
-connectionUri
-- Returns:
-
pool
public static PgPool pool(Vertx vertx, PoolOptions options)
Likepool()
with thedatabase
retrieved from the environment variables.- Parameters:
vertx
-options
-- Returns:
-
pool
public static PgPool pool(Vertx vertx, String connectionUri, PoolOptions poolOptions)
- Parameters:
vertx
-connectionUri
-poolOptions
-- Returns:
-
pool
public static PgPool pool(PgConnectOptions database, PoolOptions options)
Create a connection pool to the PostgreSQLdatabase
configured with the givenoptions
.- Parameters:
database
- the databaseoptions
- the options for creating the pool- Returns:
- the connection pool
-
pool
public static PgPool pool(Vertx vertx, PgConnectOptions database, PoolOptions options)
Likepool()
with a specific instance.- Parameters:
vertx
-database
-options
-- Returns:
-
pool
public static PgPool pool(List<PgConnectOptions> databases, PoolOptions poolOptions)
Create a connection pool to the PostgreSQLdatabases
with round-robin selection. Round-robin is applied when a new connection is created by the pool.- Parameters:
databases
- the list of databasespoolOptions
- the options for creating the pool- Returns:
- the connection pool
-
pool
public static PgPool pool(Vertx vertx, List<PgConnectOptions> databases, PoolOptions poolOptions)
Likepool()
with a specific instance.- Parameters:
vertx
-databases
-poolOptions
-- Returns:
-
client
public static SqlClient client(PoolOptions options)
Likeclient()
withdatabase
retrieved from the environment variables.- Parameters:
options
-- Returns:
-
client
public static SqlClient client(String connectionUri)
Likepool()
with default options.- Parameters:
connectionUri
-- Returns:
-
client
public static SqlClient client(String connectionUri, PoolOptions options)
- Parameters:
connectionUri
-options
-- Returns:
-
client
public static SqlClient client(Vertx vertx, String connectionUri)
Likeclient()
with default options.- Parameters:
vertx
-connectionUri
-- Returns:
-
client
public static SqlClient client(Vertx vertx, PoolOptions poolOptions)
Likeclient()
withdatabase
retrieved from the environment variables.- Parameters:
vertx
-poolOptions
-- Returns:
-
client
public static SqlClient client(Vertx vertx, String connectionUri, PoolOptions options)
- Parameters:
vertx
-connectionUri
-options
-- Returns:
-
client
public static SqlClient client(PgConnectOptions database, PoolOptions options)
Create a client backed by a connection pool to the PostgreSQLdatabase
configured with the givenoptions
.- Parameters:
database
-options
- the options for creating the backing pool- Returns:
- the pooled client
-
client
public static SqlClient client(Vertx vertx, PgConnectOptions database, PoolOptions options)
Likeclient()
with a specific instance.- Parameters:
vertx
-database
-options
-- Returns:
-
client
public static SqlClient client(Vertx vertx, List<PgConnectOptions> databases, PoolOptions options)
Likeclient()
with a specific instance.- Parameters:
vertx
-databases
-options
-- Returns:
-
client
public static SqlClient client(List<PgConnectOptions> databases, PoolOptions options)
Create a client backed by a connection pool to the PostgreSQLdatabases
with round-robin selection. Round-robin is applied when a new connection is created by the pool.- Parameters:
databases
- the list of databasesoptions
- the options for creating the pool- Returns:
- the pooled client
-
connectHandler
public PgPool connectHandler(Handler<SqlConnection> handler)
Description copied from class:Pool
Set an handler called when the pool has established a connection to the database.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(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)
to release the connection to the pool.- Overrides:
connectHandler
in classPool
- Parameters:
handler
- the handler- Returns:
- a reference to this, so the API can be used fluently
-
connectionProvider
public PgPool connectionProvider(Function<Context,Future<SqlConnection>> provider)
Description copied from class:Pool
Replace the default pool connection provider, the newprovider
returns a future connection for a given .A
ConnectionFactory
can be used as connection provider.- Overrides:
connectionProvider
in classPool
- Parameters:
provider
- the new connection provider- Returns:
- a reference to this, so the API can be used fluently
-
connectionProvider
public PgPool connectionProvider(io.reactivex.functions.Function<Context,io.reactivex.Single<SqlConnection>> provider)
Description copied from class:Pool
Replace the default pool connection provider, the newprovider
returns a future connection for a given .A
ConnectionFactory
can be used as connection provider.- Overrides:
connectionProvider
in classPool
- Parameters:
provider
- the new connection provider- Returns:
- a reference to this, so the API can be used fluently
-
pool
public static PgPool pool(Supplier<Future<PgConnectOptions>> databases, PoolOptions poolOptions)
Create a connection pool to the PostgreSQLdatabases
. The supplier is called to provide the options when a new connection is created by the pool.- Parameters:
databases
- the databases supplierpoolOptions
- the options for creating the pool- Returns:
- the connection pool
-
pool
public static PgPool pool(Vertx vertx, Supplier<Future<PgConnectOptions>> databases, PoolOptions poolOptions)
Likepool()
with a specific instance.- Parameters:
vertx
-databases
-poolOptions
-- Returns:
-
client
public static SqlClient client(Vertx vertx, Supplier<Future<PgConnectOptions>> databases, PoolOptions options)
Likeclient()
with a specific instance.- Parameters:
vertx
-databases
-options
-- Returns:
-
client
public static SqlClient client(Supplier<Future<PgConnectOptions>> databases, PoolOptions options)
Create a client backed by a connection pool to the PostgreSQLdatabases
. The supplier is called to provide the options when a new connection is created by the pool.- Parameters:
databases
- the databases supplieroptions
- the options for creating the pool- Returns:
- the pooled client
-
-