PgConnection

A connection to Postgres.

package

Default

Methods

__construct

__construct() 

Begin a transaction and returns a for controlling and tracking this transaction.

begin() : \io\vertx\jphp\pgclient\Transaction

When the connection is explicitely closed, any inflight transaction is rollbacked.

Response

\io\vertx\jphp\pgclient\Transaction

the transaction instance

Send a request cancellation message to tell the server to cancel processing request in this connection.

cancelRequest( $arg0) : \io\vertx\jphp\pgclient\PgConnection


Note: Use this with caution because the cancellation signal may or may not have any effect.

Arguments

$arg0

callable

Response

\io\vertx\jphp\pgclient\PgConnection

a reference to this, so the API can be used fluently

Close the current connection after all the pending commands have been processed.

close() : void

closeHandler

closeHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

Like @see \io\vertx\jphp\pgclient\PgConnection::connect with options build from the environment variables.

connect( $arg0,  $arg1,  $arg2 = null) : void
static

param $vertx [Vertx] param $handler [callable] connect($vertx, $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.

param $vertx [Vertx] the vertx instance param $options [PgConnectOptions | array] the connect options param $handler [callable] the handler called with the connection or the failure connect($vertx, $options, $handler)

Like @see \io\vertx\jphp\pgclient\PgConnection::connect with options build from connectionUri.

param $vertx [Vertx] param $connectionUri [string] param $handler [callable] connect($vertx, $connectionUri, $handler)

Arguments

$arg0

Vertx

$arg1

PgConnectOptions | callable | string | array

$arg2

callable

exceptionHandler

exceptionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

isSSL

isSSL() : boolean

Response

boolean

whether the connection uses SSL

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

notificationHandler( $arg0) : $this

The handler is called with the @see \io\vertx\jphp\pgclient\PgNotification and has access to the channel name and the notification payload.

Arguments

$arg0

callable

Response

$this

the transaction instance

prepare

prepare( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

preparedBatch

preparedBatch( $arg0,  $arg1,  $arg2) : $this

Arguments

$arg0

string

$arg1

array

$arg2

callable

Response

$this

param $sql [string] param $handler [callable] <b> preparedQuery($sql, $handler) </b>

preparedQuery( $arg0,  $arg1,  $arg2 = null) : $this

param $sql [string] param $arguments [Tuple] param $handler [callable] preparedQuery($sql, $arguments, $handler)

Arguments

$arg0

string

$arg1

callable | Tuple

$arg2

callable

Response

$this

processId

processId() : integer

Response

integer

The process ID of the target backend

query

query( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

callable

Response

$this

secretKey

secretKey() : integer

Response

integer

The secret key for the target backend