io.vertx.rxjava.pgclient

## Class PgConnection

- java.lang.Object
- - io.vertx.rxjava.sqlclient.SqlClient
  - - io.vertx.rxjava.sqlclient.SqlConnection
    - - io.vertx.rxjava.pgclient.PgConnection

-     public class PgConnection
      extends SqlConnection

  A connection to Postgres.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<PgConnection>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PgConnection(PgConnection delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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.
    `PgConnection` | `closeHandler(Handler<Void> handler)` Set an handler called when the connection is closed.
    `static void` | `connect(Vertx vertx, Handler<AsyncResult<PgConnection>> handler)` Like `connect(io.vertx.rxjava.core.Vertx, io.vertx.pgclient.PgConnectOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.pgclient.PgConnection>>)` with options build from the environment variables.
    `static void` | `connect(Vertx vertx, PgConnectOptions options, Handler<AsyncResult<PgConnection>> handler)` Connects to the database and returns the connection if that succeeds.
    `static void` | `connect(Vertx vertx, String connectionUri, Handler<AsyncResult<PgConnection>> handler)` Like `connect(io.vertx.rxjava.core.Vertx, io.vertx.pgclient.PgConnectOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.pgclient.PgConnection>>)` 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.
    `PgConnection` | `prepare(String sql, Handler<AsyncResult<PreparedQuery>> handler)` Create a prepared query.
    `PgConnection` | `preparedBatch(String sql, List<Tuple> batch, Handler<AsyncResult<RowSet>> handler)` Prepare and execute a createBatch.
    `PgConnection` | `preparedQuery(String sql, Handler<AsyncResult<RowSet>> handler)` Prepare and execute a query.
    `PgConnection` | `preparedQuery(String sql, Tuple arguments, Handler<AsyncResult<RowSet>> handler)` Prepare and execute a query.
    `int` | `processId()`
    `PgConnection` | `query(String sql, Handler<AsyncResult<RowSet>> handler)` Execute a simple query.
    `static Single<PgConnection>` | `rxConnect(Vertx vertx)` Like `connect(io.vertx.rxjava.core.Vertx, io.vertx.pgclient.PgConnectOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.pgclient.PgConnection>>)` 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.rxjava.core.Vertx, io.vertx.pgclient.PgConnectOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.pgclient.PgConnection>>)` with options build from `connectionUri`.
    `Single<PreparedQuery>` | `rxPrepare(String sql)` Create a prepared query.
    `Single<RowSet>` | `rxPreparedBatch(String sql, List<Tuple> batch)` Prepare and execute a createBatch.
    `Single<RowSet>` | `rxPreparedQuery(String sql)` Prepare and execute a query.
    `Single<RowSet>` | `rxPreparedQuery(String sql, Tuple arguments)` Prepare and execute a query.
    `Single<RowSet>` | `rxQuery(String sql)` Execute a simple query.
    `int` | `secretKey()`
    `String` | `toString()`

    - ### Methods inherited from class io.vertx.rxjava.sqlclient.SqlConnection

      `begin, close, isSSL, newInstance`

    - ### Methods inherited from class io.vertx.rxjava.sqlclient.SqlClient

      `newInstance`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<PgConnection> __TYPE_ARG

  - ### Constructor Detail

    - #### PgConnection

          public PgConnection(PgConnection delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `SqlConnection`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `SqlConnection`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `SqlConnection`

    - #### getDelegate

          public PgConnection getDelegate()

      Overrides:
        `getDelegate` in class `SqlConnection`

    - #### connect

          public static void connect(Vertx vertx,
                                     PgConnectOptions options,
                                     Handler<AsyncResult<PgConnection>> handler)

      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 instance
        `options` - the connect options
        `handler` - the handler called with the connection or the failure

    - #### rxConnect

          public static Single<PgConnection> rxConnect(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 instance
        `options` - the connect options
      Returns:

    - #### connect

          public static void connect(Vertx vertx,
                                     Handler<AsyncResult<PgConnection>> handler)

      Like `connect(io.vertx.rxjava.core.Vertx, io.vertx.pgclient.PgConnectOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.pgclient.PgConnection>>)` with options build from the environment variables.
      Parameters:
        `vertx` -
        `handler` -

    - #### rxConnect

          public static Single<PgConnection> rxConnect(Vertx vertx)

      Like `connect(io.vertx.rxjava.core.Vertx, io.vertx.pgclient.PgConnectOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.pgclient.PgConnection>>)` with options build from the environment variables.
      Parameters:
        `vertx` -
      Returns:

    - #### connect

          public static void connect(Vertx vertx,
                                     String connectionUri,
                                     Handler<AsyncResult<PgConnection>> handler)

      Like `connect(io.vertx.rxjava.core.Vertx, io.vertx.pgclient.PgConnectOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.pgclient.PgConnection>>)` with options build from `connectionUri`.
      Parameters:
        `vertx` -
        `connectionUri` -
        `handler` -

    - #### rxConnect

          public static Single<PgConnection> rxConnect(Vertx vertx,
                                                       String connectionUri)

      Like `connect(io.vertx.rxjava.core.Vertx, io.vertx.pgclient.PgConnectOptions, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.rxjava.pgclient.PgConnection>>)` with options build from `connectionUri`.
      Parameters:
        `vertx` -
        `connectionUri` -
      Returns:

    - #### notificationHandler

          public PgConnection notificationHandler(Handler<PgNotification> handler)

      Set an handler called when the connection receives notification on a channel.

      The handler is called with the `PgNotification` and has access to the channel name and the notification payload.
      Parameters:
        `handler` - the handler
      Returns:
        the transaction instance

    - #### cancelRequest

          public PgConnection cancelRequest(Handler<AsyncResult<Void>> handler)

      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.
      Parameters:
        `handler` - the handler notified if cancelling request is sent
      Returns:
        a reference to this, so the API can be used fluently

    - #### processId

          public int processId()

      Returns:
        The process ID of the target backend

    - #### secretKey

          public int secretKey()

      Returns:
        The secret key for the target backend

    - #### prepare

          public PgConnection prepare(String sql,
                                      Handler<AsyncResult<PreparedQuery>> handler)

      Description copied from class: `SqlConnection`
      Create a prepared query.
      Overrides:
        `prepare` in class `SqlConnection`
      Parameters:
        `sql` - the sql
        `handler` - the handler notified with the prepared query asynchronously
      Returns:

    - #### rxPrepare

          public Single<PreparedQuery> rxPrepare(String sql)

      Description copied from class: `SqlConnection`
      Create a prepared query.
      Overrides:
        `rxPrepare` in class `SqlConnection`
      Parameters:
        `sql` - the sql
      Returns:

    - #### exceptionHandler

          public PgConnection exceptionHandler(Handler<Throwable> handler)

      Description copied from class: `SqlConnection`
      Set an handler called with connection errors.
      Overrides:
        `exceptionHandler` in class `SqlConnection`
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### closeHandler

          public PgConnection closeHandler(Handler<Void> handler)

      Description copied from class: `SqlConnection`
      Set an handler called when the connection is closed.
      Overrides:
        `closeHandler` in class `SqlConnection`
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedQuery

          public PgConnection preparedQuery(String sql,
                                            Handler<AsyncResult<RowSet>> handler)

      Description copied from class: `SqlClient`
      Prepare and execute a query.
      Overrides:
        `preparedQuery` in class `SqlConnection`
      Parameters:
        `sql` - the prepared query SQL
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### rxPreparedQuery

          public Single<RowSet> rxPreparedQuery(String sql)

      Description copied from class: `SqlClient`
      Prepare and execute a query.
      Overrides:
        `rxPreparedQuery` in class `SqlConnection`
      Parameters:
        `sql` - the prepared query SQL
      Returns:
        a reference to this, so the API can be used fluently

    - #### query

          public PgConnection query(String sql,
                                    Handler<AsyncResult<RowSet>> handler)

      Description copied from class: `SqlClient`
      Execute a simple query.
      Overrides:
        `query` in class `SqlConnection`
      Parameters:
        `sql` - the query SQL
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### rxQuery

          public Single<RowSet> rxQuery(String sql)

      Description copied from class: `SqlClient`
      Execute a simple query.
      Overrides:
        `rxQuery` in class `SqlConnection`
      Parameters:
        `sql` - the query SQL
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedQuery

          public PgConnection preparedQuery(String sql,
                                            Tuple arguments,
                                            Handler<AsyncResult<RowSet>> handler)

      Description copied from class: `SqlClient`
      Prepare and execute a query.
      Overrides:
        `preparedQuery` in class `SqlConnection`
      Parameters:
        `sql` - the prepared query SQL
        `arguments` - the list of arguments
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### rxPreparedQuery

          public Single<RowSet> rxPreparedQuery(String sql,
                                                Tuple arguments)

      Description copied from class: `SqlClient`
      Prepare and execute a query.
      Overrides:
        `rxPreparedQuery` in class `SqlConnection`
      Parameters:
        `sql` - the prepared query SQL
        `arguments` - the list of arguments
      Returns:
        a reference to this, so the API can be used fluently

    - #### preparedBatch

          public PgConnection preparedBatch(String sql,
                                            List<Tuple> batch,
                                            Handler<AsyncResult<RowSet>> handler)

      Description copied from class: `SqlClient`
      Prepare and execute a createBatch.
      Overrides:
        `preparedBatch` in class `SqlConnection`
      Parameters:
        `sql` - the prepared query SQL
        `batch` - the batch of tuples
        `handler` - the handler notified with the execution result
      Returns:
        a reference to this, so the API can be used fluently

    - #### rxPreparedBatch

          public Single<RowSet> rxPreparedBatch(String sql,
                                                List<Tuple> batch)

      Description copied from class: `SqlClient`
      Prepare and execute a createBatch.
      Overrides:
        `rxPreparedBatch` in class `SqlConnection`
      Parameters:
        `sql` - the prepared query SQL
        `batch` - the batch of tuples
      Returns:
        a reference to this, so the API can be used fluently

    - #### newInstance

          public static PgConnection newInstance(PgConnection arg)

Copyright © 2019 Eclipse. All rights reserved.