Package io.vertx.rxjava3.pgclient
Class PgConnection
java.lang.Object
io.vertx.rxjava3.sqlclient.SqlClient
io.vertx.rxjava3.sqlclient.SqlConnection
io.vertx.rxjava3.pgclient.PgConnection
- All Implemented Interfaces:
RxDelegate
A connection to Postgres.
The connection object supports all the operations defined in the interface, it also provides additional support:
- Notification
- Request Cancellation
NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.CompletableSend a request cancellation message to tell the server to cancel processing request in this connection.static PgConnectioncast(SqlConnection sqlConnection) Cast a toPgConnection.closeHandler(Handler<Void> handler) Set an handler called when the connection is closed.static io.reactivex.rxjava3.core.Single<PgConnection>connect(io.vertx.rxjava3.core.Vertx vertx) Likeconnect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions)with options build from the environment variables.static io.reactivex.rxjava3.core.Single<PgConnection>connect(io.vertx.rxjava3.core.Vertx vertx, PgConnectOptions options) Connects to the database and returns the connection if that succeeds.static io.reactivex.rxjava3.core.Single<PgConnection>Likeconnect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions)with options build fromconnectionUri.booleanexceptionHandler(Handler<Throwable> handler) Set an handler called with connection errors.inthashCode()static PgConnectionnewInstance(PgConnection arg) noticeHandler(Handler<PgNotice> handler) Set a handler called when the connection receives a notice from the server.notificationHandler(Handler<PgNotification> handler) Set a handler called when the connection receives notification on a channel.intio.reactivex.rxjava3.core.CompletableSend a request cancellation message to tell the server to cancel processing request in this connection.static io.reactivex.rxjava3.core.Single<PgConnection>rxConnect(io.vertx.rxjava3.core.Vertx vertx) Likeconnect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions)with options build from the environment variables.static io.reactivex.rxjava3.core.Single<PgConnection>rxConnect(io.vertx.rxjava3.core.Vertx vertx, PgConnectOptions options) Connects to the database and returns the connection if that succeeds.static io.reactivex.rxjava3.core.Single<PgConnection>Likeconnect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions)with options build fromconnectionUri.inttoString()Methods inherited from class io.vertx.rxjava3.sqlclient.SqlConnection
begin, databaseMetadata, isSSL, newInstance, prepare, prepare, rxBegin, rxPrepare, rxPrepare, transactionMethods inherited from class io.vertx.rxjava3.sqlclient.SqlClient
close, newInstance, preparedQuery, preparedQuery, query, rxClose
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
PgConnection
-
PgConnection
-
-
Method Details
-
toString
- Overrides:
toStringin classSqlConnection
-
equals
- Overrides:
equalsin classSqlConnection
-
hashCode
public int hashCode()- Overrides:
hashCodein classSqlConnection
-
getDelegate
- Specified by:
getDelegatein interfaceRxDelegate- Overrides:
getDelegatein classSqlConnection
-
connect
public static io.reactivex.rxjava3.core.Single<PgConnection> connect(io.vertx.rxjava3.core.Vertx vertx, PgConnectOptions options) Connects to the database and returns the connection if that succeeds. The connection interracts directly with the database is not a proxy, so closing the connection will close the underlying connection to the database.- Parameters:
vertx- the vertx instanceoptions- the connect options- Returns:
- a future notified with the connection or the failure
-
rxConnect
public static io.reactivex.rxjava3.core.Single<PgConnection> rxConnect(io.vertx.rxjava3.core.Vertx vertx, PgConnectOptions options) Connects to the database and returns the connection if that succeeds. The connection interracts directly with the database is not a proxy, so closing the connection will close the underlying connection to the database.- Parameters:
vertx- the vertx instanceoptions- the connect options- Returns:
- a future notified with the connection or the failure
-
connect
public static io.reactivex.rxjava3.core.Single<PgConnection> connect(io.vertx.rxjava3.core.Vertx vertx) Likeconnect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions)with options build from the environment variables.- Parameters:
vertx-- Returns:
-
rxConnect
public static io.reactivex.rxjava3.core.Single<PgConnection> rxConnect(io.vertx.rxjava3.core.Vertx vertx) Likeconnect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions)with options build from the environment variables.- Parameters:
vertx-- Returns:
-
connect
public static io.reactivex.rxjava3.core.Single<PgConnection> connect(io.vertx.rxjava3.core.Vertx vertx, String connectionUri) Likeconnect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions)with options build fromconnectionUri.- Parameters:
vertx-connectionUri-- Returns:
-
rxConnect
public static io.reactivex.rxjava3.core.Single<PgConnection> rxConnect(io.vertx.rxjava3.core.Vertx vertx, String connectionUri) Likeconnect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions)with options build fromconnectionUri.- Parameters:
vertx-connectionUri-- Returns:
-
notificationHandler
Set a handler called when the connection receives notification on a channel. The handler is called with thePgNotificationand has access to the channel name and the notification payload.- Parameters:
handler- the handler- Returns:
- the transaction instance
-
noticeHandler
Set a handler called when the connection receives a notice from the server.- Parameters:
handler-- Returns:
-
cancelRequest
public io.reactivex.rxjava3.core.Completable cancelRequest()Send a request cancellation message to tell the server to cancel processing request in this connection.
Note: Use this with caution because the cancellation signal may or may not have any effect.- Returns:
- a future notified if cancelling request is sent
-
rxCancelRequest
public io.reactivex.rxjava3.core.Completable rxCancelRequest()Send a request cancellation message to tell the server to cancel processing request in this connection.
Note: Use this with caution because the cancellation signal may or may not have any effect.- Returns:
- a future notified if cancelling request is sent
-
processId
public int processId()- Returns:
- The process ID of the target backend
-
secretKey
public int secretKey()- Returns:
- The secret key for the target backend
-
exceptionHandler
Description copied from class:SqlConnectionSet an handler called with connection errors.- Overrides:
exceptionHandlerin classSqlConnection- Parameters:
handler-- Returns:
-
closeHandler
Description copied from class:SqlConnectionSet an handler called when the connection is closed.- Overrides:
closeHandlerin classSqlConnection- Parameters:
handler-- Returns:
-
cast
Cast a toPgConnection. This is mostly useful for Vert.x generated APIs like RxJava/Mutiny.- Parameters:
sqlConnection- the connection to cast- Returns:
- a
instance
-
newInstance
-