Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PgConnection

A connection to Postgres.

The connection object supports all the operations defined in the interface, it also provides additional support:

  • Notification
  • Request Cancellation

Hierarchy

  • any
    • PgConnection

Index

Methods

cancelRequest

  • cancelRequest(handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): PgConnection
  • 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: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns PgConnection

closeHandler

  • closeHandler(handler: ((res: void) => void) | Handler<void>): PgConnection
  • Parameters

    • handler: ((res: void) => void) | Handler<void>

    Returns PgConnection

exceptionHandler

  • exceptionHandler(handler: ((res: Throwable) => void) | Handler<Throwable>): PgConnection
  • Parameters

    • handler: ((res: Throwable) => void) | Handler<Throwable>

    Returns PgConnection

noticeHandler

  • Set a handler called when the connection receives a notice from the server.

    Parameters

    Returns PgConnection

notificationHandler

  • Set a 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

    Returns PgConnection

prepare

  • prepare(sql: string): PromiseLike<PreparedStatement>
  • prepare(sql: string, handler: ((res: AsyncResult<PreparedStatement>) => void) | Handler<AsyncResult<PreparedStatement>>): PgConnection
  • Parameters

    • sql: string

    Returns PromiseLike<PreparedStatement>

  • Parameters

    • sql: string
    • handler: ((res: AsyncResult<PreparedStatement>) => void) | Handler<AsyncResult<PreparedStatement>>

    Returns PgConnection

processId

  • processId(): number
  • Returns number

secretKey

  • secretKey(): number
  • Returns number

Static cast

  • Cast a to PgConnection.

    This is mostly useful for Vert.x generated APIs like RxJava/Mutiny.

    Parameters

    • sqlConnection: SqlConnection

    Returns PgConnection

Static connect

  • 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

    Returns PromiseLike<PgConnection>

  • 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

    Returns void

  • Like {@link PgConnection#connect} with options build from the environment variables.

    Parameters

    • vertx: Vertx

    Returns PromiseLike<PgConnection>

  • Like {@link PgConnection#connect} with options build from the environment variables.

    Parameters

    Returns void

  • Like {@link PgConnection#connect} with options build from connectionUri.

    Parameters

    • vertx: Vertx
    • connectionUri: string

    Returns PromiseLike<PgConnection>

  • Like {@link PgConnection#connect} with options build from connectionUri.

    Parameters

    • vertx: Vertx
    • connectionUri: string
    • handler: ((res: AsyncResult<PgConnection>) => void) | Handler<AsyncResult<PgConnection>>

    Returns void

Generated using TypeDoc