public class PgConnection extends SqlConnection
The connection object supports all the operations defined in the interface, it also provides additional support:
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<PgConnection> |
__TYPE_ARG |
Constructor and Description |
---|
PgConnection(Object delegate) |
PgConnection(PgConnection delegate) |
Modifier and Type | Method and Description |
---|---|
PgConnection |
cancelRequest(Handler<AsyncResult<Void>> handler)
Send a request cancellation message to tell the server to cancel processing request in this connection.
|
static PgConnection |
cast(SqlConnection sqlConnection)
Cast a to
PgConnection . |
PgConnection |
closeHandler(Handler<Void> handler)
Set an handler called when the connection is closed.
|
static Single<PgConnection> |
connect(Vertx vertx)
Like
connect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions) with options build from the environment variables. |
static Single<PgConnection> |
connect(Vertx vertx,
PgConnectOptions options)
Connects to the database and returns the connection if that succeeds.
|
static Single<PgConnection> |
connect(Vertx vertx,
String connectionUri)
Like
connect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions) with options build from connectionUri . |
boolean |
equals(Object o) |
PgConnection |
exceptionHandler(Handler<Throwable> handler)
Set an handler called with connection errors.
|
PgConnection |
getDelegate() |
int |
hashCode() |
static PgConnection |
newInstance(PgConnection arg) |
PgConnection |
notificationHandler(Handler<PgNotification> handler)
Set an handler called when the connection receives notification on a channel.
|
Single<PreparedStatement> |
prepare(String sql)
Create a prepared statement using the given
sql string. |
int |
processId() |
static Single<PgConnection> |
rxConnect(Vertx vertx)
Like
connect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions) with options build from the environment variables. |
static Single<PgConnection> |
rxConnect(Vertx vertx,
PgConnectOptions options)
Connects to the database and returns the connection if that succeeds.
|
static Single<PgConnection> |
rxConnect(Vertx vertx,
String connectionUri)
Like
connect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions) with options build from connectionUri . |
Single<PreparedStatement> |
rxPrepare(String sql)
Create a prepared statement using the given
sql string. |
int |
secretKey() |
String |
toString() |
begin, close, databaseMetadata, isSSL, newInstance, rxBegin, rxClose
newInstance, preparedQuery, query
public static final io.vertx.lang.rx.TypeArg<PgConnection> __TYPE_ARG
public PgConnection(PgConnection delegate)
public PgConnection(Object delegate)
public String toString()
toString
in class SqlConnection
public boolean equals(Object o)
equals
in class SqlConnection
public int hashCode()
hashCode
in class SqlConnection
public PgConnection getDelegate()
getDelegate
in class SqlConnection
public static Single<PgConnection> connect(Vertx vertx, PgConnectOptions options)
vertx
- the vertx instanceoptions
- the connect optionspublic static Single<PgConnection> rxConnect(Vertx vertx, PgConnectOptions options)
vertx
- the vertx instanceoptions
- the connect optionspublic static Single<PgConnection> connect(Vertx vertx)
connect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions)
with options build from the environment variables.vertx
- public static Single<PgConnection> rxConnect(Vertx vertx)
connect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions)
with options build from the environment variables.vertx
- public static Single<PgConnection> connect(Vertx vertx, String connectionUri)
connect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions)
with options build from connectionUri
.vertx
- connectionUri
- public static Single<PgConnection> rxConnect(Vertx vertx, String connectionUri)
connect(io.vertx.rxjava3.core.Vertx, io.vertx.pgclient.PgConnectOptions)
with options build from connectionUri
.vertx
- connectionUri
- public PgConnection notificationHandler(Handler<PgNotification> handler)
PgNotification
and has access to the channel name
and the notification payload.handler
- the handlerpublic PgConnection cancelRequest(Handler<AsyncResult<Void>> handler)
handler
- the handler notified if cancelling request is sentpublic int processId()
public int secretKey()
public Single<PreparedStatement> prepare(String sql)
SqlConnection
sql
string.prepare
in class SqlConnection
sql
- public Single<PreparedStatement> rxPrepare(String sql)
SqlConnection
sql
string.rxPrepare
in class SqlConnection
sql
- public PgConnection exceptionHandler(Handler<Throwable> handler)
SqlConnection
exceptionHandler
in class SqlConnection
handler
- public PgConnection closeHandler(Handler<Void> handler)
SqlConnection
closeHandler
in class SqlConnection
handler
- public static PgConnection cast(SqlConnection sqlConnection)
PgConnection
.
This is mostly useful for Vert.x generated APIs like RxJava/Mutiny.sqlConnection
- the connection to castinstance
public static PgConnection newInstance(PgConnection arg)
Copyright © 2021 Eclipse. All rights reserved.