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 theoriginalnon 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 SqlClientclient()Likeclient()with default options.static SqlClientclient(io.vertx.pgclient.PgConnectOptions database, io.vertx.sqlclient.PoolOptions options)Create a client backed by a connection pool to the PostgreSQLdatabaseconfigured with the givenoptions.static SqlClientclient(Vertx vertx, io.vertx.pgclient.PgConnectOptions database, io.vertx.sqlclient.PoolOptions options)Likeclient()with a specific instance.static SqlClientclient(Vertx vertx, io.vertx.sqlclient.PoolOptions poolOptions)Likeclient()withdatabaseretrieved from the environment variables.static SqlClientclient(Vertx vertx, String connectionUri)Likeclient()with default options.static SqlClientclient(Vertx vertx, String connectionUri, io.vertx.sqlclient.PoolOptions options)static SqlClientclient(Vertx vertx, List<io.vertx.pgclient.PgConnectOptions> databases, io.vertx.sqlclient.PoolOptions options)Likeclient()with a specific instance.static SqlClientclient(io.vertx.sqlclient.PoolOptions options)Likeclient()withdatabaseretrieved from the environment variables.static SqlClientclient(String connectionUri)Likepool()with default options.static SqlClientclient(String connectionUri, io.vertx.sqlclient.PoolOptions options)static SqlClientclient(List<io.vertx.pgclient.PgConnectOptions> databases, io.vertx.sqlclient.PoolOptions options)Create a client backed by a connection pool to the PostgreSQLdatabaseswith round-robin selection.PgPoolconnectHandler(io.vertx.core.Handler<SqlConnection> handler)Set an handler called when the pool has established a connection to the database.PgPoolconnectionProvider(io.reactivex.functions.Function<Context,io.reactivex.Single<SqlConnection>> provider)Replace the default pool connection provider, the newproviderreturns a future connection for a given .PgPoolconnectionProvider(Function<Context,io.vertx.core.Future<SqlConnection>> provider)Replace the default pool connection provider, the newproviderreturns a future connection for a given .booleanequals(Object o)io.vertx.pgclient.PgPoolgetDelegate()inthashCode()static PgPoolnewInstance(io.vertx.pgclient.PgPool arg)static PgPoolpool()Likepool()with a defaultpoolOptions.static PgPoolpool(io.vertx.pgclient.PgConnectOptions database, io.vertx.sqlclient.PoolOptions options)Create a connection pool to the PostgreSQLdatabaseconfigured with the givenoptions.static PgPoolpool(Vertx vertx, io.vertx.pgclient.PgConnectOptions database, io.vertx.sqlclient.PoolOptions options)Likepool()with a specific instance.static PgPoolpool(Vertx vertx, io.vertx.sqlclient.PoolOptions options)Likepool()with thedatabaseretrieved from the environment variables.static PgPoolpool(Vertx vertx, String connectionUri)Likepool()with default options.static PgPoolpool(Vertx vertx, String connectionUri, io.vertx.sqlclient.PoolOptions poolOptions)static PgPoolpool(Vertx vertx, List<io.vertx.pgclient.PgConnectOptions> databases, io.vertx.sqlclient.PoolOptions poolOptions)Likepool()with a specific instance.static PgPoolpool(io.vertx.sqlclient.PoolOptions options)Likepool()withconnectOptionsbuild from the environment variables.static PgPoolpool(String connectionUri)Likepool()with a defaultpoolOptions.static PgPoolpool(String connectionUri, io.vertx.sqlclient.PoolOptions options)static PgPoolpool(List<io.vertx.pgclient.PgConnectOptions> databases, io.vertx.sqlclient.PoolOptions poolOptions)Create a connection pool to the PostgreSQLdatabaseswith round-robin selection.StringtoString()-
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, size, withConnection, withConnection, withConnection, withConnection, withTransaction, withTransaction, withTransaction, withTransaction
-
Methods inherited from class io.vertx.reactivex.sqlclient.SqlClient
newInstance, preparedQuery
-
-
-
-
Constructor Detail
-
PgPool
public PgPool(io.vertx.pgclient.PgPool delegate)
-
PgPool
public PgPool(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.pgclient.PgPool getDelegate()
- Overrides:
getDelegatein classPool
-
pool
public static PgPool pool(io.vertx.sqlclient.PoolOptions options)
Likepool()withconnectOptionsbuild 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, io.vertx.sqlclient.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, io.vertx.sqlclient.PoolOptions options)
Likepool()with thedatabaseretrieved from the environment variables.- Parameters:
vertx-options-- Returns:
-
pool
public static PgPool pool(Vertx vertx, String connectionUri, io.vertx.sqlclient.PoolOptions poolOptions)
- Parameters:
vertx-connectionUri-poolOptions-- Returns:
-
pool
public static PgPool pool(io.vertx.pgclient.PgConnectOptions database, io.vertx.sqlclient.PoolOptions options)
Create a connection pool to the PostgreSQLdatabaseconfigured with the givenoptions.- Parameters:
database- the databaseoptions- the options for creating the pool- Returns:
- the connection pool
-
pool
public static PgPool pool(Vertx vertx, io.vertx.pgclient.PgConnectOptions database, io.vertx.sqlclient.PoolOptions options)
Likepool()with a specific instance.- Parameters:
vertx-database-options-- Returns:
-
pool
public static PgPool pool(List<io.vertx.pgclient.PgConnectOptions> databases, io.vertx.sqlclient.PoolOptions poolOptions)
Create a connection pool to the PostgreSQLdatabaseswith 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<io.vertx.pgclient.PgConnectOptions> databases, io.vertx.sqlclient.PoolOptions poolOptions)
Likepool()with a specific instance.- Parameters:
vertx-databases-poolOptions-- Returns:
-
client
public static SqlClient client(io.vertx.sqlclient.PoolOptions options)
Likeclient()withdatabaseretrieved 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, io.vertx.sqlclient.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, io.vertx.sqlclient.PoolOptions poolOptions)
Likeclient()withdatabaseretrieved from the environment variables.- Parameters:
vertx-poolOptions-- Returns:
-
client
public static SqlClient client(Vertx vertx, String connectionUri, io.vertx.sqlclient.PoolOptions options)
- Parameters:
vertx-connectionUri-options-- Returns:
-
client
public static SqlClient client(io.vertx.pgclient.PgConnectOptions database, io.vertx.sqlclient.PoolOptions options)
Create a client backed by a connection pool to the PostgreSQLdatabaseconfigured with the givenoptions.- Parameters:
database-options- the options for creating the backing pool- Returns:
- the pooled client
-
client
public static SqlClient client(Vertx vertx, io.vertx.pgclient.PgConnectOptions database, io.vertx.sqlclient.PoolOptions options)
Likeclient()with a specific instance.- Parameters:
vertx-database-options-- Returns:
-
client
public static SqlClient client(Vertx vertx, List<io.vertx.pgclient.PgConnectOptions> databases, io.vertx.sqlclient.PoolOptions options)
Likeclient()with a specific instance.- Parameters:
vertx-databases-options-- Returns:
-
client
public static SqlClient client(List<io.vertx.pgclient.PgConnectOptions> databases, io.vertx.sqlclient.PoolOptions options)
Create a client backed by a connection pool to the PostgreSQLdatabaseswith 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(io.vertx.core.Handler<SqlConnection> handler)
Description copied from class:PoolSet 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:
connectHandlerin classPool- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
connectionProvider
public PgPool connectionProvider(Function<Context,io.vertx.core.Future<SqlConnection>> provider)
Description copied from class:PoolReplace the default pool connection provider, the newproviderreturns a future connection for a given .A
ConnectionFactorycan be used as connection provider.- Overrides:
connectionProviderin 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:PoolReplace the default pool connection provider, the newproviderreturns a future connection for a given .A
ConnectionFactorycan be used as connection provider.- Overrides:
connectionProviderin classPool- Parameters:
provider- the new connection provider- Returns:
- a reference to this, so the API can be used fluently
-
newInstance
public static PgPool newInstance(io.vertx.pgclient.PgPool arg)
-
-