### Highlights:
-* Nearly 100% support for [asynchronous usage](pq/Connection/: Asynchronous Usage).
-* Extended [type support by pg_type](pq/Types/: Overview).
+* Nearly 100% support for [asynchronous usage](pq/Connection/:%20Asynchronous%20Usage).
+* Extended [type support by pg_type](pq/Types/:%20Overview).
* Fetching simple [multi-dimensional array maps](pq/Result/map).
* Working [Gateway implementation](https://bitbucket.org/m6w6/pq-gateway).
# void pq\Cancel::__construct(pq\Connection $conn)
-Create a new cancellation request for an [asynchronous](pq/Connection/: Asynchronous Usage) query.
+Create a new cancellation request for an [asynchronous](pq/Connection/:%20Asynchronous%20Usage) query.
## Params:
The connection to the PostgreSQL server.
-See the [General Usage](pq/Connection/: General Usage) page for an introduction on how to use this class.
+See the [General Usage](pq/Connection/:%20General%20Usage) page for an introduction on how to use this class.
## Constants:
### Connection Flags:
* PERSISTENT
(Re-)open a persistent connection.
* ASYNC
-If the connection is not already open, perform the connection attempt [asynchronously](pq/Connection/: Asynchronous Usage).
+If the connection is not already open, perform the connection attempt [asynchronously](pq/Connection/:%20Asynchronous%20Usage).
### Connection Status:
* OK
* public (readonly) resource $socket
The server socket resource.
* public (readonly) bool $busy
- Whether the connection is busy with [asynchronous operations](pq/Connection/: Asynchronous Usage).
+ Whether the connection is busy with [asynchronous operations](pq/Connection/:%20Asynchronous%20Usage).
* public (readonly) string $errorMessage
Any error message on failure.
* public (readonly) array $eventHandlers
* public string $encoding = NULL
Connection character set.
* public bool $unbuffered = FALSE
- Whether to fetch [asynchronous](pq/Connection/: Asynchronous Usage) results in unbuffered mode, i.e. each row generates a distinct pq\Result.
+ Whether to fetch [asynchronous](pq/Connection/:%20Asynchronous%20Usage) results in unbuffered mode, i.e. each row generates a distinct pq\Result.
* public bool $nonblocking = FALSE
Whether to set the underlying socket nonblocking, useful for asynchronous handling of writes. See also pq\Connection::flush().
$result = $c->exec("SELECT 1*s,2*s,3*s FROM generate_series(1,3) s");
?>
-An object of class pq\Result is returned on success. See [Fetching results](pq/Result/: Fetching Results) for details.
+An object of class pq\Result is returned on success. See [Fetching results](pq/Result/:%20Fetching%20Results) for details.
> ***NOTE:***
> Only the last result will be returned, if the query string contains more than one SQL query.
The second argument is an ***array of parameters*** to execute the prepared statement with.
-If the third argument is present, an ***array with pg_type OIDs***, those types will be used for the parameters. See [Using types](pq/Types/: Overview) for details.
+If the third argument is present, an ***array with pg_type OIDs***, those types will be used for the parameters. See [Using types](pq/Types/:%20Overview) for details.
<?php
$result = $c->execParams("SELECT int($1) * s, int($2) * s, int($3) * s FROM generate_series(1,3) s", array(1,2,3));
?>
-An object of class pq\Result is returned on success. See [Fetching results](pq/Result/: Fetching Results) for details.
+An object of class pq\Result is returned on success. See [Fetching results](pq/Result/:%20Fetching%20Results) for details.
## Explicit prepare & execute of a named statement
The second argument is a ***query string*** containing a single SQL query, which will be prepared on the server.
-If the third argument is present, an ***array with pg_type OIDs***, those types will be used for the parameters. See [Using types](pq/Types/: Overview) for details.
+If the third argument is present, an ***array with pg_type OIDs***, those types will be used for the parameters. See [Using types](pq/Types/:%20Overview) for details.
<?php
# void pq\Connection::__construct([string $dsn = ""[, int $flags = 0]])
Create a new PostgreSQL connection.
-See also [General Usage](pq/Connection/: General Usage).
+See also [General Usage](pq/Connection/:%20General%20Usage).
## Params:
* Optional string $dsn = ""
# pq\Cursor pq\Connection::declareAsync(string $name, int $flags, string $query)
-[Asynchronously](pq/Connection/: Asynchronous Usage) declare a cursor for a query.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) declare a cursor for a query.
> ***NOTE***:
If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
# pq\Result pq\Connection::exec(string $query)
-[Execute one or multiple SQL queries](pq/Connection/: Executing Queries) on the connection.
+[Execute one or multiple SQL queries](pq/Connection/:%20Executing%20Queries) on the connection.
> ***NOTE:***
> Only the last result will be returned, if the query string contains more than one SQL query.
# void pq\Connection::exec(string $query[, callable $callback])
-[Asynchronously](pq/Connection/: Asynchronous Usage) [execute an SQL query](pq/Connection: Executing Queries) on the connection.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) [execute an SQL query](pq/Connection:%20Executing%20Queries) on the connection.
> ***NOTE***:
If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
# pq\Result pq\Connection::execParams(string $query, array $params[, array $types = NULL])
-[Execute an SQL query](pq/Connection: Executing Queries) with properly escaped parameters substituted.
+[Execute an SQL query](pq/Connection:%20Executing%20Queries) with properly escaped parameters substituted.
## Params:
# pq\Result pq\Connection::execParamsAsync(string $query, array $params[, array $types = NULL, [callable $cb = NULL]])
-[Asynchronously](pq/Connection/: Asynchronous Usage) [execute an SQL query](pq/Connection: Executing Queries) with properly escaped parameters substituted.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) [execute an SQL query](pq/Connection:%20Executing%20Queries) with properly escaped parameters substituted.
> ***NOTE***:
If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
# pq\Result pq\Connection::getResult()
-Fetch the result of an [asynchronous](pq/Connection/: Asynchronous Usage) query.
+Fetch the result of an [asynchronous](pq/Connection/:%20Asynchronous%20Usage) query.
If the query hasn't finished yet, the call will block until the result is available.
# void pq\Connection::listenAsync(string $channel, callable $listener)
-[Asynchronously](pq/Connection/: Asynchronous Usage) start listening on $channel for notifcations.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) start listening on $channel for notifcations.
See pq\Connection::listen().
## Params:
# void pq\Connection::notifyAsync(string $channel, string $message)
-[Asynchronously](pq/Connection/: Asynchronous Usage) start notifying all listeners on $channel with $message.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) start notifying all listeners on $channel with $message.
## Params:
# int pq\Connection::poll()
-Poll an [asynchronously](pq/Connection/: Asynchronous Usage) operating connection.
+Poll an [asynchronously](pq/Connection/:%20Asynchronous%20Usage) operating connection.
See pq\Connection::resetAsync() for an usage example.
## Params:
# pq\Statement pq\Connection::prepareAsync(string $name, string $query[, array $types = NULL])
-[Asynchronously](pq/Connection/: Asynchronous Usage) prepare a named statement for later execution with pq\Statement::exec().
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) prepare a named statement for later execution with pq\Statement::exec().
> ***NOTE***:
If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
# void pq\Connection::resetAsync()
-[Asynchronously](pq/Connection/: Asynchronous Usage) reset a possibly broken connection to a working state.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) reset a possibly broken connection to a working state.
## Params:
# pq\Transaction pq\Connection::startTransactionAsync([int $isolation = pq\Transaction::READ_COMMITTED[, bool $readonly = FALSE[, bool $deferrable = FALSE]]])
-[Asynchronously](pq/Connection/: Asynchronous Usage) begin a transaction.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) begin a transaction.
## Params:
# void pq\Connection::unlistenAsync(string $channel)
-[Asynchronously](pq/Connection/: Asynchronous Usage) stop listening for notifications on channel $channel.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) stop listening for notifications on channel $channel.
See pq\Connection::unlisten() and pq\Connection::listenAsync().
## Params:
* string $query
The query for which the cursor should be opened.
* bool $async
- Whether to declare the cursor [asynchronously](pq/Connection/: Asynchronous Usage).
+ Whether to declare the cursor [asynchronously](pq/Connection/:%20Asynchronous%20Usage).
## Throws:
# void pq\Cursor::closeAsync()
-[Asynchronously](pq/Connection/: Asynchronous Usage) close an open cursor.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) close an open cursor.
See pq\Cursor::close().
## Params:
# void pq\Cursor::fetchAsync([string $spec = "1"[, callable $callback = NULL]])
-[Asynchronously](pq/Connection/: Asynchronous Usage) fetch rows from the cursor.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) fetch rows from the cursor.
See pq\Cursor::fetch().
## Params:
# void pq\Cursor::moveAsync([string $spec = "1"])
-[Asynchronously](pq/Connection/: Asynchronous Usage) move the cursor.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) move the cursor.
See pq\Cursor::move().
## Params:
# void pq\Cursor::openAsync()
-[Asynchronously](pq/Connection/: Asynchronous Usage) reopen a cursor.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) reopen a cursor.
See pq\Cursor::open().
## Params:
A query result.
-See [Fetching Results](pq/Result/: Fetching Results) for a general overview.
+See [Fetching Results](pq/Result/:%20Fetching%20Results) for a general overview.
## Constants:
# pq\Result: Overview
-An synchronous pq\Connection::exec*() call, or calls to pq\Connection::getResult() after using [asynchronous queries](pq/Connection/: Asynchronous Usage) returns an instance of pq\Result on success. See [Query execution](pq/Connection/: Executing Queries), optionally with [types](pq/Types/: Overview) and [Prepared Statements](pq/Statement) for details about how to execute queries.
+An synchronous pq\Connection::exec*() call, or calls to pq\Connection::getResult() after using [asynchronous queries](pq/Connection/:%20Asynchronous%20Usage) returns an instance of pq\Result on success. See [Query execution](pq/Connection/:%20Executing%20Queries), optionally with [types](pq/Types/:%20Overview) and [Prepared Statements](pq/Statement) for details about how to execute queries.
## Fetch types:
* Optional array $types = NULL
A list of corresponding query parameter type OIDs.
* Optional bool $async = FALSE
- Whether to prepare the statement [asynchronously](pq/Connection/: Asynchronous Usage).
+ Whether to prepare the statement [asynchronously](pq/Connection/:%20Asynchronous%20Usage).
## Throws:
# void pq\Statement::deallocateAsync()
-[Asynchronously](pq/Connection/: Asynchronous Usage) free the server resources used by the
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) free the server resources used by the
prepared statement, so it can no longer be executed.
## Params:
# void pq\Statement::descAsync(callable $callback)
-[Asynchronously](pq/Connection/: Asynchronous Usage) describe the parameters of the prepared statement.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) describe the parameters of the prepared statement.
## Params:
# void pq\Statement::execAsync([array $params = NULL, [callable $cb = NULL]])
-[Asynchronously](pq/Connection/: Asynchronous Usage) execute the prepared statement.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) execute the prepared statement.
## Params:
# void pq\Statement::prepareAsync()
-[Asynchronously](pq/Connection/: Asynchronous Usage) re-prepare a statement that has been
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) re-prepare a statement that has been
deallocated. This is a no-op on already open statements.
## Params:
* pq\Connection $conn
The connection to start the transaction on.
* Optional bool $async = FALSE
- Whether to start the transaction [asynchronously](pq/Connection/: Asynchronous Usage).
+ Whether to start the transaction [asynchronously](pq/Connection/:%20Asynchronous%20Usage).
* Optional int $isolation = pq\Transaction::READ_COMMITTED
The transaction isolation level (defaults to pq\Connection::$defaultTransactionIsolation).
* Optional bool $readonly = FALSE
# void pq\Transaction::commitAsync()
-[Asynchronously](pq/Connection/: Asynchronous Usage) commit the transaction or release the previous savepoint.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) commit the transaction or release the previous savepoint.
See pq\Transaction::commit() and pq\Transaction::savepoint().
## Params:
# void pq\Transaction::exportSnapshotAsync()
-[Asynchronously](pq/Connection/: Asynchronous Usage) export a snapshot for transaction synchronization.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) export a snapshot for transaction synchronization.
See pq\Transaction::exportSnapshot().
## Params:
# void pq\Transaction::importSnapshotAsync(string $snapshot_id)
-[Asynchronously](pq/Connection/: Asynchronous Usage) import a snapshot from another transaction to synchronize with.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) import a snapshot from another transaction to synchronize with.
See pq\Transaction::importSnapshot().
> ***NOTE:***
# void pq\Transaction::rollbackAsync()
-[Asynchronously](pq/Connection/: Asynchronous Usage) rollback the transaction or to the previous savepoint within this transaction.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) rollback the transaction or to the previous savepoint within this transaction.
See pq\Transaction::rollback() and pq\Transaction::savepoint().
## Params:
# void pq\Transaction::savepointAsync()
-[Asynchronously](pq/Connection/: Asynchronous Usage) create a `SAVEPOINT` within this transaction.
+[Asynchronously](pq/Connection/:%20Asynchronous%20Usage) create a `SAVEPOINT` within this transaction.
See pq\Transaction::savepoint().
## Params:
# class pq\Types implements ArrayAccess
Accessor to the PostgreSQL `pg_type` relation.
-See [here for an overview](pq/Types/: Overview).
+See [here for an overview](pq/Types/:%20Overview).
## Example:
> ***NOTE:***
The pg_type relation fields have a ``typ`` prefix.
-## Usage when [executing queries](pq/Connection/: Executing Queries)
+## Usage when [executing queries](pq/Connection/:%20Executing%20Queries)
<?php