1 # void pq\Connection::exec(string $query[, callable $callback])
3 [Asynchronously](pq/Connection/: Asynchronous Usage) [execute an SQL query](pq/Connection: Executing Queries) on the connection.
6 If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
11 The query to send to the server.
12 * Optional callable $callback as function(pq\Result $res)
13 The callback to execute when the query finishes.
17 * pq\Exception\InvalidArgumentException
18 * pq\Exception\BadMethodCallException
19 * pq\Exception\RuntimeException
25 $connection = new pq\Connection;
26 $connection->execAsync("SELECT 1", function($res) {
29 $connection->getResult();