Merge pull request #1 from DaveRandom/fix/statement-descasync-arg
[mdref/mdref-pq] / pq / Connection / prepareAsync.md
1 # pq\Statement pq\Connection::prepareAsync(string $name, string $query[, array $types = NULL])
2
3 [Asynchronously](pq/Connection/: Asynchronous Usage) prepare a named statement for later execution with pq\Statement::exec().
4
5 > ***NOTE***:
6 If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
7
8 ## Params:
9
10 * string $name
11 The identifying name of the prepared statement.
12 * string $query
13 The query to prepare.
14 * Optional array $types = NULL
15 An array of type OIDs for the substitution parameters.
16
17 ## Returns:
18
19 * pq\Statement, a prepared statement instance.
20
21 ## Throws:
22
23 * pq\Exception\InvalidArgumentException
24 * pq\Exception\BadMethodCallException
25 * pq\Exception\RuntimeException