typo, parameter and type fixes
[mdref/mdref-pq] / pq.stub.php
1 <?php
2 /**
3 * This is a modern binding to the mature [libpq](http://www.postgresql.org/docs/current/static/libpq.html), the official PostgreSQL C-client library.
4 *
5 * ### Highlights:
6 *
7 * * Nearly 100% support for [asynchronous usage](pq/Connection/: Asynchronous Usage).
8 * * Extended [type support by pg_type](pq/Types/: Overview).
9 * * Fetching simple [multi-dimensional array maps](pq/Result/map).
10 * * Working [Gateway implementation](https://bitbucket.org/m6w6/pq-gateway).
11 */
12 namespace pq;
13 use pq;
14 /**
15 * Fast import/export using COPY.
16 */
17 class COPY {
18 /**
19 * Start a COPY operation from STDIN to the PostgreSQL server.
20 */
21 const FROM_STDIN = 0;
22 /**
23 * Start a COPY operation from the server to STDOUT.
24 */
25 const TO_STDOUT = 1;
26 /**
27 * Start a COPY operation.
28 *
29 * @param \pq\Connection $conn The connection to use for the COPY operation.
30 * @param string $expression The expression generating the data to copy.
31 * @param int $direction Data direction (pq\COPY::FROM_STDIN or pq\COPY::TO_STDOUT).
32 * @param string $options Any COPY options (see the [official PostgreSQL documentation](http://www.postgresql.org/docs/current/static/sql-copy.html) for details.
33 * @throws \pq\Exception\InvalidArgumentException
34 * @throws \pq\Exception\BadMethodCallException
35 * @throws \pq\Exception\RuntimeException
36 */
37 function __construct(\pq\Connection $conn, string $expression, int $direction, string $options = NULL) {}
38 /**
39 * End the COPY operation to the server during pq\Result::COPY_IN state.
40 *
41 * @param string $error If set, the COPY operation will abort with provided message.
42 * @throws \pq\Exception\InvalidArgumentException
43 * @throws \pq\Exception\BadMethodCallException
44 * @throws \pq\Exception\RuntimeException
45 */
46 function end(string $error = NULL) {}
47 /**
48 * Receive data from the server during pq\Result::COPY_OUT state.
49 *
50 * @param string $data Data read from the server.
51 * @throws \pq\Exception\InvalidArgumentException
52 * @throws \pq\Exception\BadMethodCallException
53 * @throws \pq\Exception\RuntimeException
54 * @return bool success.
55 */
56 function get(string &$data) {}
57 /**
58 * Send data to the server during pq\Result::COPY_IN state.
59 *
60 * @param string $data Data to send to the server.
61 * @throws \pq\Exception\InvalidArgumentException
62 * @throws \pq\Exception\BadMethodCallException
63 * @throws \pq\Exception\RuntimeException
64 */
65 function put(string $data) {}
66 }
67 /**
68 * Request cancellation of an asynchronous query.
69 */
70 class Cancel {
71 /**
72 * Create a new cancellation request for an [asynchronous](pq/Connection/: Asynchronous Usage) query.
73 *
74 * @param \pq\Connection $conn The connection to request cancellation on.
75 * @throws \pq\Exception\InvalidArgumentException
76 * @throws \pq\Exception\BadMethodCallException
77 * @throws \pq\Exception\RuntimeException
78 */
79 function __construct(\pq\Connection $conn) {}
80 /**
81 * Perform the cancellation request.
82 *
83 * @throws \pq\Exception\InvalidArgumentException
84 * @throws \pq\Exception\BadMethodCallException
85 * @throws \pq\Exception\RuntimeException
86 */
87 function cancel() {}
88 }
89 /**
90 * The connection to the PostgreSQL server.
91 *
92 * See the [General Usage](pq/Connection/: General Usage) page for an introduction on how to use this class.
93 */
94 class Connection {
95 /**
96 * (Re-)open a persistent connection.
97 */
98 const PERSISTENT = 2;
99 /**
100 * If the connection is not already open, perform the connection attempt [asynchronously](pq/Connection/: Asynchronous Usage).
101 */
102 const ASYNC = 1;
103 /**
104 * Everything well; if a connection has been newly and synchronously created, the connection will always have this status right after creation.
105 */
106 const OK = 0;
107 /**
108 * Broken connection; consider pq\Connection::reset() or recreation.
109 */
110 const BAD = 1;
111 /**
112 * Waiting for connection to be made.
113 */
114 const STARTED = 2;
115 /**
116 * Connection okay; waiting to send.
117 */
118 const MADE = 3;
119 /**
120 * Waiting for a response from the server.
121 */
122 const AWAITING_RESPONSE = 4;
123 /**
124 * Received authentication; waiting for backend start-up to finish.
125 */
126 const AUTH_OK = 5;
127 /**
128 * Negotiating SSL encryption.
129 */
130 const SSL_STARTUP = 7;
131 /**
132 * Negotiating environment-driven parameter settings.
133 */
134 const SETENV = 6;
135 /**
136 * No active transaction.
137 */
138 const TRANS_IDLE = 0;
139 /**
140 * A transaction command is in progress.
141 */
142 const TRANS_ACTIVE = 1;
143 /**
144 * Idling in a valid transaction block.
145 */
146 const TRANS_INTRANS = 2;
147 /**
148 * Idling in a failed transaction block.
149 */
150 const TRANS_INERROR = 3;
151 /**
152 * Bad connection.
153 */
154 const TRANS_UNKNOWN = 4;
155 /**
156 * The connection procedure has failed.
157 */
158 const POLLING_FAILED = 0;
159 /**
160 * Select for read-readiness.
161 */
162 const POLLING_READING = 1;
163 /**
164 * Select for write-readiness.
165 */
166 const POLLING_WRITING = 2;
167 /**
168 * The connection has been successfully made.
169 */
170 const POLLING_OK = 3;
171 /**
172 * Register the event handler for notices.
173 */
174 const EVENT_NOTICE = 'notice';
175 /**
176 * Register the event handler for any created results.
177 */
178 const EVENT_RESULT = 'result';
179 /**
180 * Register the event handler for connection resets.
181 */
182 const EVENT_RESET = 'reset';
183 /**
184 * Connection character set.
185 *
186 * @public
187 * @var string
188 */
189 public $encoding = NULL;
190 /**
191 * Whether to fetch [asynchronous](pq/Connection/: Asynchronous Usage) results in unbuffered mode, i.e. each row generates a distinct pq\Result.
192 *
193 * @public
194 * @var bool
195 */
196 public $unbuffered = FALSE;
197 /**
198 * Whether to set the underlying socket nonblocking, useful for asynchronous handling of writes. See also pq\Connection::flush().
199 *
200 * ### Connection Information:
201 *
202 * @public
203 * @var bool
204 */
205 public $nonblocking = FALSE;
206 /**
207 * Default fetch type for future pq\Result instances.
208 *
209 * @public
210 * @var int
211 */
212 public $defaultFetchType = \pq\Result::FETCH_ARRAY;
213 /**
214 * Default conversion bitmask for future pq\Result instances.
215 *
216 * @public
217 * @var int
218 */
219 public $defaultAutoConvert = \pq\Result::CONV_ALL;
220 /**
221 * Default transaction isolation level for future pq\Transaction instances.
222 *
223 * @public
224 * @var int
225 */
226 public $defaultTransactionIsolation = \pq\Transaction::READ_COMMITTED;
227 /**
228 * Default transaction readonlyness for future pq\Transaction instances.
229 *
230 * @public
231 * @var bool
232 */
233 public $defaultTransactionReadonly = FALSE;
234 /**
235 * Default transaction deferrability for future pq\Transaction instances.
236 *
237 * @public
238 * @var bool
239 */
240 public $defaultTransactionDeferrable = FALSE;
241 /**
242 * Create a new PostgreSQL connection.
243 * See also [General Usage](pq/Connection/: General Usage).
244 *
245 * @param string $dsn A ***connection string*** as described [in the PostgreSQL documentation](http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING).
246 * @param int $flags See [connection flag constants](pq/Connection#Connection.Flags:).
247 * @throws \pq\Exception\InvalidArgumentException
248 * @throws \pq\Exception\BadMethodCallException
249 * @throws \pq\Exception\RuntimeException
250 */
251 function __construct(string $dsn = "", int $flags = 0) {}
252 /**
253 * Declare a cursor for a query.
254 *
255 * @param string $name The identifying name of the cursor.
256 * @param int $flags Any combination of pq\Cursor constants.
257 * @param string $query The query for which to open a cursor.
258 * @throws \pq\Exception\InvalidArgumentException
259 * @throws \pq\Exception\RuntimeException
260 * @throws \pq\Exception\BadMethodCallException
261 * @return \pq\Cursor an open cursor instance.
262 */
263 function declare(string $name, int $flags, string $query) {}
264 /**
265 * [Asynchronously](pq/Connection/: Asynchronous Usage) declare a cursor for a query.
266 *
267 * > ***NOTE***:
268 * If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
269 *
270 * @param string $name The identifying name of the cursor.
271 * @param int $flags Any combination of pq\Cursor constants.
272 * @param string $query The query for which to open a cursor.
273 * @throws \pq\Exception\InvalidArgumentException
274 * @throws \pq\Exception\RuntimeException
275 * @throws \pq\Exception\BadMethodCallException
276 * @return \pq\Cursor an open cursor instance.
277 */
278 function declareAsync(string $name, int $flags, string $query) {}
279 /**
280 * Escape binary data for use within a query with the type bytea.
281 *
282 * > ***NOTE:***
283 * The result is not wrapped in single quotes.
284 *
285 * @param string $binary The binary data to escape.
286 * @throws \pq\Exception\BadMethodCallException
287 * @return string|FALSE string the escaped binary data.
288 * or FALSE if escaping fails.
289 */
290 function escapeBytea(string $binary) {}
291 /**
292 * [Execute one or multiple SQL queries](pq/Connection/: Executing Queries) on the connection.
293 *
294 * > ***NOTE:***
295 * > Only the last result will be returned, if the query string contains more than one SQL query.
296 *
297 * @param string $query The queries to send to the server, separated by semi-colon.
298 * @throws \pq\Exception\InvalidArgumentException
299 * @throws \pq\Exception\BadMethodCallException
300 * @throws \pq\Exception\RuntimeException
301 * @throws \pq\Exception\DomainException
302 * @return \pq\Result
303 */
304 function exec(string $query) {}
305 /**
306 * [Asynchronously](pq/Connection/: Asynchronous Usage) [execute an SQL query](pq/Connection: Executing Queries) on the connection.
307 *
308 * > ***NOTE***:
309 * If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
310 *
311 * @param string $query The query to send to the server.
312 * @param callable $callback as function(pq\Result $res)
313 * The callback to execute when the query finishes.
314 * @throws \pq\Exception\InvalidArgumentException
315 * @throws \pq\Exception\BadMethodCallException
316 * @throws \pq\Exception\RuntimeException
317 */
318 function execAsync(string $query, callable $callback = NULL) {}
319 /**
320 * [Execute an SQL query](pq/Connection: Executing Queries) with properly escaped parameters substituted.
321 *
322 * @param string $query The query to execute.
323 * @param array $params The parameter list to substitute.
324 * @param array $types Corresponding list of type OIDs for the parameters.
325 * @throws \pq\Exception\InvalidArgumentException
326 * @throws \pq\Exception\RuntimeException
327 * @throws \pq\Exception\DomainException
328 * @return \pq\Result
329 */
330 function execParams(string $query, array $params, array $types = NULL) {}
331 /**
332 * [Asynchronously](pq/Connection/: Asynchronous Usage) [execute an SQL query](pq/Connection: Executing Queries) with properly escaped parameters substituted.
333 *
334 * > ***NOTE***:
335 * If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
336 *
337 * @param string $query The query to execute.
338 * @param array $params The parameter list to substitute.
339 * @param array $types Corresponding list of type OIDs for the parameters.
340 * @param callable $cb as function(\pq\Result $res) : void
341 * Result handler callback.
342 * @throws \pq\Exception\InvalidArgumentException
343 * @throws \pq\Exception\RuntimeException
344 * @throws \pq\Exception\BadMethodCallException
345 */
346 function execParamsAsync(string $query, array $params, array $types = NULL, callable $cb = NULL) {}
347 /**
348 * Flush pending writes on the connection.
349 * Call after sending any command or data on a nonblocking connection.
350 *
351 * If it returns FALSE, wait for the socket to become read or write-ready.
352 * If it becomes write-ready, call pq\Connection::flush() again.
353 * If it becomes read-ready, call pq\Connection::poll(), then call pq\Connection::flush() again.
354 * Repeat until pq\Connection::flush() returns TRUE.
355 *
356 * > ***NOTE:***
357 * > This method was added in v1.1.0, resp. v2.1.0.
358 *
359 * @throws \pq\Exception\InvalidArgumentException
360 * @throws \pq\Exception\RuntimeException
361 * @return bool whether everything has been flushed.
362 */
363 function flush() {}
364 /**
365 * Fetch the result of an [asynchronous](pq/Connection/: Asynchronous Usage) query.
366 *
367 * If the query hasn't finished yet, the call will block until the result is available.
368 *
369 * @throws \pq\Exception\InvalidArgumentException
370 * @throws \pq\Exception\BadMethodCallException
371 * @return NULL|\pq\Result NULL if there has not been a query
372 * or \pq\Result when the query has finished
373 */
374 function getResult() {}
375 /**
376 * Listen on $channel for notifications.
377 * See pq\Connection::unlisten().
378 *
379 * @param string $channel The channel to listen on.
380 * @param callable $listener as function(string $channel, string $message, int $pid)
381 * A callback automatically called whenever a notification on $channel arrives.
382 * @throws \pq\Exception\InvalidArgumentException
383 * @throws \pq\Exception\BadMethodCallException
384 * @throws \pq\Exception\RuntimeException
385 */
386 function listen(string $channel, callable $listener) {}
387 /**
388 * [Asynchronously](pq/Connection/: Asynchronous Usage) start listening on $channel for notifcations.
389 * See pq\Connection::listen().
390 *
391 * @param string $channel The channel to listen on.
392 * @param callable $listener as function(string $channel, string $message, int $pid)
393 * A callback automatically called whenever a notification on $channel arrives.
394 * @throws \pq\Exception\InvalidArgumentException
395 * @throws \pq\Exception\BadMethodCallException
396 * @throws \pq\Exception\RuntimeException
397 */
398 function listenAsync(string $channel, callable $listener) {}
399 /**
400 * Notify all listeners on $channel with $message.
401 *
402 * @param string $channel The channel to notify.
403 * @param string $message The message to send.
404 * @throws \pq\Exception\InvalidArgumentException
405 * @throws \pq\Exception\BadMethodCallException
406 * @throws \pq\Exception\RuntimeException
407 */
408 function notify(string $channel, string $message) {}
409 /**
410 * [Asynchronously](pq/Connection/: Asynchronous Usage) start notifying all listeners on $channel with $message.
411 *
412 * @param string $channel The channel to notify.
413 * @param string $message The message to send.
414 * @throws \pq\Exception\InvalidArgumentException
415 * @throws \pq\Exception\BadMethodCallException
416 * @throws \pq\Exception\RuntimeException
417 */
418 function notifyAsync(string $channel, string $message) {}
419 /**
420 * Stops listening for an event type.
421 *
422 * @param string $event Any pq\Connection::EVENT_*.
423 * @throws \pq\Exception\InvalidArgumentException
424 * @throws \pq\Exception\BadMethodCallException
425 * @return bool success.
426 */
427 function off(string $event) {}
428 /**
429 * Listen for an event.
430 *
431 * @param string $event Any pq\Connection::EVENT_*.
432 * @param callable $callback as function(pq\Connection $c[, pq\Result $r)
433 * The callback to invoke on event.
434 * @throws \pq\Exception\InvalidArgumentException
435 * @throws \pq\Exception\BadMethodCallException
436 * @return int number of previously attached event listeners.
437 */
438 function on(string $event, callable $callback) {}
439 /**
440 * Poll an [asynchronously](pq/Connection/: Asynchronous Usage) operating connection.
441 * See pq\Connection::resetAsync() for an usage example.
442 *
443 * @throws \pq\Exception\InvalidArgumentException
444 * @throws \pq\Exception\RuntimeException
445 * @throws \pq\Exception\BadMethodCallException
446 * @return int pq\Connection::POLLING_* constant
447 */
448 function poll() {}
449 /**
450 * Prepare a named statement for later execution with pq\Statement::execute().
451 *
452 * @param string $name The identifying name of the prepared statement.
453 * @param string $query The query to prepare.
454 * @param array $types An array of type OIDs for the substitution parameters.
455 * @throws \pq\Exception\InvalidArgumentException
456 * @throws \pq\Exception\BadMethodCallException
457 * @throws \pq\Exception\RuntimeException
458 * @return \pq\Statement a prepared statement instance.
459 */
460 function prepare(string $name, string $query, array $types = NULL) {}
461 /**
462 * [Asynchronously](pq/Connection/: Asynchronous Usage) prepare a named statement for later execution with pq\Statement::exec().
463 *
464 * > ***NOTE***:
465 * If pq\Connection::$unbuffered is TRUE, each call to pq\Connection::getResult() will generate a distinct pq\Result containing exactly one row.
466 *
467 * @param string $name The identifying name of the prepared statement.
468 * @param string $query The query to prepare.
469 * @param array $types An array of type OIDs for the substitution parameters.
470 * @throws \pq\Exception\InvalidArgumentException
471 * @throws \pq\Exception\BadMethodCallException
472 * @throws \pq\Exception\RuntimeException
473 * @return \pq\Statement a prepared statement instance.
474 */
475 function prepareAsync(string $name, string $query, array $types = NULL) {}
476 /**
477 * Quote a string for safe use in a query.
478 * The result is truncated at any zero byte and wrapped in single quotes.
479 *
480 * > ***NOTE:***
481 * Beware of matching character encodings.
482 *
483 * @param string $payload The payload to quote for use in a query.
484 * @throws \pq\Exception\BadMethodCallException
485 * @return string|FALSE string a single-quote wrapped string safe for literal use in a query.
486 * or FALSE if quoting fails.
487 */
488 function quote(string $payload) {}
489 /**
490 * Quote an identifier for safe usage as name.
491 *
492 * > ***NOTE:***
493 * Beware of case-sensitivity.
494 *
495 * @param string $name The name to quote.
496 * @throws \pq\Exception\BadMethodCallException
497 * @return string|FALSE string the quoted identifier.
498 * or FALSE if quoting fails.
499 */
500 function quoteName(string $name) {}
501 /**
502 * Attempt to reset a possibly broken connection to a working state.
503 *
504 * @throws \pq\Exception\InvalidArgumentException
505 * @throws \pq\Exception\BadMethodCallException
506 * @throws \pq\Exception\RuntimeException
507 */
508 function reset() {}
509 /**
510 * [Asynchronously](pq/Connection/: Asynchronous Usage) reset a possibly broken connection to a working state.
511 *
512 * @throws \pq\Exception\InvalidArgumentException
513 * @throws \pq\Exception\BadMethodCallException
514 * @throws \pq\Exception\RuntimeException
515 */
516 function resetAsync() {}
517 /**
518 * Set a data type converter.
519 *
520 * @param \pq\Converter $converter An instance implementing pq\Converter.
521 * @throws \pq\Exception\InvalidArgumentException
522 * @throws \pq\Exception\BadMethodCallException
523 */
524 function setConverter(\pq\Converter $converter) {}
525 /**
526 * Begin a transaction.
527 *
528 * @param int $isolation Any pq\Transaction isolation level constant
529 * (defaults to pq\Connection::$defaultTransactionIsolation).
530 * @param bool $readonly Whether the transaction executes only reads
531 * (defaults to pq\Connection::$defaultTransactionReadonly).
532 * @param bool $deferrable Whether the transaction is deferrable
533 * (defaults to pq\Connection::$defaultTransactionDeferrable).
534 *
535 * > ***NOTE:***
536 * A transaction can only be deferrable if it also is readonly and serializable.
537 * See the official [PostgreSQL documentation](http://www.postgresql.org/docs/current/static/sql-set-transaction.html) for further information.
538 * @throws \pq\Exception\InvalidArgumentException
539 * @throws \pq\Exception\BadMethodCallException
540 * @throws \pq\Exception\RuntimeException
541 * @return \pq\Transaction a begun transaction instance.
542 */
543 function startTransaction(int $isolation = \pq\Transaction::READ_COMMITTED, bool $readonly = FALSE, bool $deferrable = FALSE) {}
544 /**
545 * [Asynchronously](pq/Connection/: Asynchronous Usage) begin a transaction.
546 *
547 * @param int $isolation Any pq\Transaction isolation level constant
548 * (defaults to pq\Connection::$defaultTransactionIsolation).
549 * @param bool $readonly Whether the transaction executes only reads
550 * (defaults to pq\Connection::$defaultTransactionReadonly).
551 * @param bool $deferrable Whether the transaction is deferrable
552 * (defaults to pq\Connection::$defaultTransactionDeferrable).
553 *
554 * > ***NOTE:***
555 * A transaction can only be deferrable if it also is readonly and serializable.
556 * See the official [PostgreSQL documentation](http://www.postgresql.org/docs/current/static/sql-set-transaction.html) for further information.
557 * @throws \pq\Exception\InvalidArgumentException
558 * @throws \pq\Exception\BadMethodCallException
559 * @throws \pq\Exception\RuntimeException
560 * @return \pq\Transaction an asynchronously begun transaction instance.
561 */
562 function startTransactionAsync(int $isolation = \pq\Transaction::READ_COMMITTED, bool $readonly = FALSE, bool $deferrable = FALSE) {}
563 /**
564 * Trace protocol communication with the server.
565 *
566 * > ***NOTE:***
567 * Calling pq\Connection::trace() without argument or NULL stops tracing.
568 *
569 * @param resource $stream The resource to which the protocol trace will be output.
570 * (The stream must be castable to STDIO).
571 * @throws \pq\Exception\BadMethodCallException
572 * @return bool success.
573 */
574 function trace($stream = NULL) {}
575 /**
576 * Unescape bytea data retrieved from the server.
577 *
578 * @param string $bytea Bytea data retrieved from the server.
579 * @throws \pq\Exception\BadMethodCallException
580 * @return string|FALSE string unescaped binary data.
581 * or FALSE if unescaping fails.
582 */
583 function unescapeBytea(string $bytea) {}
584 /**
585 * Stop listening for notifications on channel $channel.
586 * See pq\Connection::listen().
587 *
588 * @param string $channel The name of a channel which is currently listened on.
589 * @throws \pq\Exception\InvalidArgumentException
590 * @throws \pq\Exception\BadMethodCallException
591 * @throws \pq\Exception\RuntimeException
592 */
593 function unlisten(string $channel) {}
594 /**
595 * [Asynchronously](pq/Connection/: Asynchronous Usage) stop listening for notifications on channel $channel.
596 * See pq\Connection::unlisten() and pq\Connection::listenAsync().
597 *
598 * @param string $channel The name of a channel which is currently listened on.
599 * @throws \pq\Exception\InvalidArgumentException
600 * @throws \pq\Exception\BadMethodCallException
601 * @throws \pq\Exception\RuntimeException
602 */
603 function unlistenAsync(string $channel) {}
604 /**
605 * Stop applying a data type converter.
606 *
607 * @param \pq\Converter $converter A converter previously set with pq\Connection::setConverter().
608 * @throws \pq\Exception\InvalidArgumentException
609 * @throws \pq\Exception\BadMethodCallException
610 */
611 function unsetConverter(\pq\Converter $converter) {}
612 }
613 /**
614 * Interface for type conversions.
615 */
616 interface Converter {
617 /**
618 * Convert a string received from the PostgreSQL server back to a PHP type.
619 *
620 * @param string $data String data received from the server.
621 * @param int $type The type OID of the data. Irrelevant for single-type converters.
622 * @return mixed the value converted to a PHP type.
623 */
624 function convertFromString(string $data, int $type);
625 /**
626 * Convert a value to a string for use in a query.
627 *
628 * @param mixed $value The PHP value which should be converted to a string.
629 * @param int $type The type OID the converter should handle. Irrelevant for singly-type converters.
630 * @return string a textual representation of the value accepted by the PostgreSQL server.
631 */
632 function convertToString($value, int $type);
633 /**
634 * Announce which types the implementing converter can handle.
635 *
636 * @return array OIDs of handled types.
637 */
638 function convertTypes();
639 }
640 /**
641 * Declare a cursor.
642 */
643 class Cursor {
644 /**
645 * Causes the cursor to return data in binary rather than in text format. You probably do not want to use that.
646 */
647 const BINARY = 1;
648 /**
649 * The data returned by the cursor should be unaffected by updates to the tables underlying the cursor that take place after the cursor was opened.
650 */
651 const INSENSITIVE = 2;
652 /**
653 * The cursor should stay usable after the transaction that created it was successfully committed.
654 */
655 const WITH_HOLD = 4;
656 /**
657 * Force that rows can be retrieved in any order from the cursor.
658 */
659 const SCROLL = 16;
660 /**
661 * Force that rows are only retrievable in sequiential order.
662 *
663 * > ***NOTE:***
664 * See the [notes in the official PostgreSQL documentation](http://www.postgresql.org/docs/current/static/sql-declare.html#SQL-DECLARE-NOTES) for more information.
665 */
666 const NO_SCROLL = 32;
667 /**
668 * Declare a cursor.
669 * See pq\Connection::declare().
670 *
671 * @param \pq\Connection $connection The connection on which the cursor should be declared.
672 * @param string $name The name of the cursor.
673 * @param int $flags See pq\Cursor constants.
674 * @param string $query The query for which the cursor should be opened.
675 * @param bool $async Whether to declare the cursor [asynchronously](pq/Connection/: Asynchronous Usage).
676 * @throws \pq\Exception\InvalidArgumentException
677 * @throws \pq\Exception\BadMethodCallException
678 * @throws \pq\Exception\RuntimeException
679 */
680 function __construct(\pq\Connection $connection, string $name, int $flags, string $query, bool $async) {}
681 /**
682 * Close an open cursor.
683 * This is a no-op on already closed cursors.
684 *
685 * @throws \pq\Exception\InvalidArgumentException
686 * @throws \pq\Exception\BadMethodCallException
687 * @throws \pq\Exception\RuntimeException
688 */
689 function close() {}
690 /**
691 * [Asynchronously](pq/Connection/: Asynchronous Usage) close an open cursor.
692 * See pq\Cursor::close().
693 *
694 * @throws \pq\Exception\InvalidArgumentException
695 * @throws \pq\Exception\BadMethodCallException
696 * @throws \pq\Exception\RuntimeException
697 */
698 function closeAsync() {}
699 /**
700 * Fetch rows from the cursor.
701 * See pq\Cursor::move().
702 *
703 * @param string $spec What to fetch.
704 *
705 * ### Fetch argument:
706 *
707 * FETCH and MOVE usually accepts arguments like the following, where `count` is the number of rows:
708 * @throws \pq\Exception\InvalidArgumentException
709 * @throws \pq\Exception\BadMethodCallException
710 * @throws \pq\Exception\RuntimeException
711 * @return \pq\Result the fetched row(s).
712 */
713 function fetch(string $spec = "1") {}
714 /**
715 * [Asynchronously](pq/Connection/: Asynchronous Usage) fetch rows from the cursor.
716 * See pq\Cursor::fetch().
717 *
718 * @param string $spec What to fetch.
719 * @param callable $callback as function(pq\Result $res)
720 * A callback to execute when the result is ready.
721 * @throws \pq\Exception\InvalidArgumentException
722 * @throws \pq\Exception\BadMethodCallException
723 * @throws \pq\Exception\RuntimeException
724 */
725 function fetchAsync(string $spec = "1", callable $callback = NULL) {}
726 /**
727 * Move the cursor.
728 * See pq\Cursor::fetch().
729 *
730 * @param string $spec What to fetch.
731 *
732 * ### Fetch argument:
733 *
734 * FETCH and MOVE usually accepts arguments like the following, where `count` is the number of rows:
735 * @throws \pq\Exception\InvalidArgumentException
736 * @throws \pq\Exception\BadMethodCallException
737 * @throws \pq\Exception\RuntimeException
738 * @return \pq\Result command status.
739 */
740 function move(string $spec = "1") {}
741 /**
742 * [Asynchronously](pq/Connection/: Asynchronous Usage) move the cursor.
743 * See pq\Cursor::move().
744 *
745 * @param string $spec What to fetch.
746 * @param callable $callback as function(pq\Result $res)
747 * A callback to execute when the command completed.
748 * @throws \pq\Exception\InvalidArgumentException
749 * @throws \pq\Exception\BadMethodCallException
750 * @throws \pq\Exception\RuntimeException
751 */
752 function moveAsync(string $spec = "1", callable $callback = NULL) {}
753 /**
754 * Reopen a cursor.
755 * This is a no-op on already open cursors.
756 *
757 * > ***NOTE:***
758 * Only cursors closed by pq\Cursor::close() will be reopened.
759 *
760 * @throws \pq\Exception\InvalidArgumentException
761 * @throws \pq\Exception\BadMethodCallException
762 * @throws \pq\Exception\RuntimeException
763 */
764 function open() {}
765 /**
766 * [Asynchronously](pq/Connection/: Asynchronous Usage) reopen a cursor.
767 * See pq\Cursor::open().
768 *
769 * @throws \pq\Exception\InvalidArgumentException
770 * @throws \pq\Exception\BadMethodCallException
771 * @throws \pq\Exception\RuntimeException
772 */
773 function openAsync() {}
774 }
775 /**
776 * A simple DateTime wrapper with predefined formats which supports stringification and JSON.
777 */
778 class DateTime extends \DateTime implements \JsonSerializable {
779 /**
780 * The default format of any date/time type automatically converted by pq\Result (depends on the actual type of the column).
781 *
782 * @public
783 * @var string
784 */
785 public $format = "Y-m-d H:i:s.uO";
786 /**
787 * Stringify the DateTime instance according to pq\DateTime::$format.
788 *
789 * @return string the DateTime as string.
790 */
791 function __toString() {}
792 /**
793 * Serialize to JSON.
794 * Alias of pq\DateTime::__toString().
795 *
796 * @return string the DateTime stringified according to pq\DateTime::$format.
797 */
798 function jsonSerialize() {}
799 }
800 /**
801 * A base interface for all pq\Exception classes.
802 */
803 interface Exception {
804 /**
805 * An invalid argument was passed to a method (pq\Exception\InvalidArgumentException).
806 */
807 const INVALID_ARGUMENT = 0;
808 /**
809 * A runtime exception occurred (pq\Exception\RuntimeException).
810 */
811 const RUNTIME = 1;
812 /**
813 * The connection failed (pq\Exception\RuntimeException).
814 */
815 const CONNECTION_FAILED = 2;
816 /**
817 * An input/output exception occurred (pq\Exception\RuntimeException).
818 */
819 const IO = 3;
820 /**
821 * Escaping an argument or identifier failed internally (pq\Exception\RuntimeException).
822 */
823 const ESCAPE = 4;
824 /**
825 * An object's constructor was not called (pq\Exception\BadMethodCallException).
826 */
827 const UNINITIALIZED = 6;
828 /**
829 * Calling this method was not expected (yet) (pq\Exception\BadMethodCallException).
830 */
831 const BAD_METHODCALL = 5;
832 /**
833 * SQL syntax error (pq\Exception\DomainException).
834 */
835 const SQL = 8;
836 /**
837 * Implementation domain error (pq\Exception\DomainException).
838 */
839 const DOMAIN = 7;
840 }
841 /**
842 * A *large object*.
843 *
844 * > ***NOTE:***
845 * Working with *large objects* requires an active transaction.
846 */
847 class LOB {
848 /**
849 * 0, representing an invalid OID.
850 */
851 const INVALID_OID = 0;
852 /**
853 * Read/write mode.
854 */
855 const RW = 393216;
856 /**
857 * Open or create a *large object*.
858 * See pq\Transaction::openLOB() and pq\Transaction::createLOB().
859 *
860 * @param \pq\Transaction $txn The transaction which wraps the *large object* operations.
861 * @param int $oid The OID of the existing *large object* to open.
862 * @param int $mode Access mode (read, write or read/write).
863 * @throws \pq\Exception\InvalidArgumentException
864 * @throws \pq\Exception\BadMethodCallException
865 * @throws \pq\Exception\RuntimeException
866 */
867 function __construct(\pq\Transaction $txn, int $oid = \pq\LOB::INVALID_OID, int $mode = \pq\LOB::RW) {}
868 /**
869 * Read a string of data from the current position of the *large object*.
870 *
871 * @param int $length The amount of bytes to read from the *large object*.
872 * @param int $read The amount of bytes actually read from the *large object*.
873 * @throws \pq\Exception\InvalidArgumentException
874 * @throws \pq\Exception\BadMethodCallException
875 * @throws \pq\Exception\RuntimeException
876 * @return string the data read.
877 */
878 function read(int $length = 0x1000, int &$read = NULL) {}
879 /**
880 * Seek to a position within the *large object*.
881 *
882 * @param int $offset The position to seek to.
883 * @param int $whence From where to seek (SEEK_SET, SEEK_CUR or SEEK_END).
884 * @throws \pq\Exception\InvalidArgumentException
885 * @throws \pq\Exception\BadMethodCallException
886 * @throws \pq\Exception\RuntimeException
887 * @return int the new position.
888 */
889 function seek(int $offset, int $whence = SEEK_SET) {}
890 /**
891 * Retrieve the current position within the *large object*.
892 *
893 * @throws \pq\Exception\InvalidArgumentException
894 * @throws \pq\Exception\BadMethodCallException
895 * @throws \pq\Exception\RuntimeException
896 * @return int the current position.
897 */
898 function tell() {}
899 /**
900 * Truncate the *large object*.
901 *
902 * @param int $length The length to truncate to.
903 * @throws \pq\Exception\InvalidArgumentException
904 * @throws \pq\Exception\BadMethodCallException
905 * @throws \pq\Exception\RuntimeException
906 */
907 function truncate(int $length = 0) {}
908 /**
909 * Write data to the *large object*.
910 *
911 * @param string $data The data that should be written to the current position.
912 * @return int the number of bytes written.
913 */
914 function write(string $data) {}
915 }
916 /**
917 * A query result.
918 *
919 * See [Fetching Results](pq/Result/: Fetching Results) for a general overview.
920 */
921 class Result implements \Traversable, \Countable {
922 /**
923 * The query sent to the server was empty.
924 */
925 const EMPTY_QUERY = 0;
926 /**
927 * The query did not generate a result set and completed successfully.
928 */
929 const COMMAND_OK = 1;
930 /**
931 * The query successfully generated a result set.
932 */
933 const TUPLES_OK = 2;
934 /**
935 * The result contains a single row of the result set when using pq\Connection::$unbuffered.
936 */
937 const SINGLE_TUPLE = 9;
938 /**
939 * COPY data can be received from the server.
940 */
941 const COPY_OUT = 3;
942 /**
943 * COPY data can be sent to the server.
944 */
945 const COPY_IN = 4;
946 /**
947 * COPY in/out data transfer in progress.
948 */
949 const COPY_BOTH = 8;
950 /**
951 * The server sent a bad response.
952 */
953 const BAD_RESPONSE = 5;
954 /**
955 * A nonfatal error (notice or warning) occurred.
956 */
957 const NONFATAL_ERROR = 6;
958 /**
959 * A fatal error occurred.
960 */
961 const FATAL_ERROR = 7;
962 /**
963 * Fetch rows numerically indexed, where the index start with 0.
964 */
965 const FETCH_ARRAY = 0;
966 /**
967 * Fetch rows associatively indexed by column name.
968 */
969 const FETCH_ASSOC = 1;
970 /**
971 * Fetch rows as stdClass instance, where the column names are the property names.
972 */
973 const FETCH_OBJECT = 2;
974 /**
975 * Automatically convert 'f' and 't' to FALSE and TRUE and vice versa.
976 */
977 const CONV_BOOL = 1;
978 /**
979 * Automatically convert integral strings to either int if it fits into maximum integer size or else to float and vice versa.
980 */
981 const CONV_INT = 2;
982 /**
983 * Automatically convert floating point numbers.
984 */
985 const CONV_FLOAT = 4;
986 /**
987 * Do all scalar conversions listed above.
988 */
989 const CONV_SCALAR = 15;
990 /**
991 * Automatically convert arrays.
992 */
993 const CONV_ARRAY = 16;
994 /**
995 * Automatically convert date strings to pq\DateTime and vice versa.
996 */
997 const CONV_DATETIME = 32;
998 /**
999 * Automatically convert JSON.
1000 */
1001 const CONV_JSON = 256;
1002 /**
1003 * Do all of the above.
1004 */
1005 const CONV_ALL = 65535;
1006 /**
1007 * The [type of return value](pq/Result#Fetch.types:) the fetch methods should return when no fetch type argument was given. Defaults to pq\Connection::$defaultFetchType.
1008 *
1009 * @public
1010 * @var int
1011 */
1012 public $fetchType = \pq\Result::FETCH_ARRAY;
1013 /**
1014 * What [type of conversions](pq/Result#Conversion.bits:) to perform automatically.
1015 *
1016 * @public
1017 * @var int
1018 */
1019 public $autoConvert = \pq\Result::CONV_ALL;
1020 /**
1021 * Bind a variable to a result column.
1022 * See pq\Result::fetchBound().
1023 *
1024 * @param mixed $col The column name or index to bind to.
1025 * @param mixed $var The variable reference.
1026 * @throws \pq\Exception\InvalidArgumentException
1027 * @throws \pq\Exception\BadMethodCallException
1028 * @return bool success.
1029 */
1030 function bind($col, $var) {}
1031 /**
1032 * Count number of rows in this result set.
1033 *
1034 * @throws \pq\Exception\InvalidArgumentException
1035 * @throws \pq\Exception\BadMethodCallException
1036 * @return int the number of rows.
1037 */
1038 function count() {}
1039 /**
1040 * Describe a prepared statement.
1041 *
1042 * > ***NOTE:***
1043 * This will only return meaningful information for a result of pq\Statement::desc().
1044 *
1045 * @throws \pq\Exception\InvalidArgumentException
1046 * @throws \pq\Exception\BadMethodCallException
1047 * @return array list of parameter type OIDs for the prepared statement.
1048 */
1049 function desc() {}
1050 /**
1051 * Fetch all rows at once.
1052 *
1053 * @param int $fetch_type The type the return value should have, see pq\Result::FETCH_* constants, defaults to pq\Result::$fetchType.
1054 * @throws \pq\Exception\InvalidArgumentException
1055 * @throws \pq\Exception\BadMethodCallException
1056 * @return array all fetched rows.
1057 */
1058 function fetchAll(int $fetch_type = NULL) {}
1059 /**
1060 * Fetch all rows of a single column.
1061 *
1062 * @param int $col The column name or index to fetch.
1063 * @throws \pq\Exception\InvalidArgumentException
1064 * @throws \pq\Exception\BadMethodCallException
1065 * @throws \pq\Exception\RuntimeException
1066 * @return array list of column values.
1067 */
1068 function fetchAllCols(int $col = 0) {}
1069 /**
1070 * Iteratively fetch a row into bound variables.
1071 * See pq\Result::bind().
1072 *
1073 * @throws \pq\Exception\InvalidArgumentException
1074 * @throws \pq\Exception\BadMethodCallException
1075 * @throws \pq\Exception\RuntimeException
1076 * @return array|NULL array the fetched row as numerically indexed array.
1077 * or NULL when iteration ends.
1078 */
1079 function fetchBound() {}
1080 /**
1081 * Iteratively fetch a single column.
1082 *
1083 * @param mixed $ref The variable where the column value will be stored in.
1084 * @param mixed $col The column name or index.
1085 * @throws \pq\Exception\InvalidArgumentException
1086 * @throws \pq\Exception\BadMethodCallException
1087 * @throws \pq\Exception\RuntimeException
1088 * @return bool|NULL bool success.
1089 * or NULL when iteration ends.
1090 */
1091 function fetchCol($ref, $col = 0) {}
1092 /**
1093 * Iteratively fetch a row.
1094 *
1095 * @param int $fetch_type The type the return value should have, see pq\Result::FETCH_* constants, defaults to pq\Result::$fetchType.
1096 * @throws \pq\Exception\InvalidArgumentException
1097 * @throws \pq\Exception\BadMethodCallException
1098 * @throws \pq\Exception\RuntimeException
1099 * @return array|array|object|NULL array numerically indexed for pq\Result::FETCH_ARRAY
1100 * or array associatively indexed for pq\Result::FETCH_ASSOC
1101 * or object stdClass instance for pq\Result::FETCH_OBJECT
1102 * or NULL when iteration ends.
1103 */
1104 function fetchRow(int $fetch_type = NULL) {}
1105 /**
1106 * Fetch the complete result set as a simple map, a *multi dimensional array*, each dimension indexed by a column.
1107 *
1108 * @param mixed $keys The the column indices/names used to index the map.
1109 * @param mixed $vals The column indices/names which should build up the leaf entry of the map.
1110 * @param int $fetch_type The type the return value should have, see pq\Result::FETCH_* constants, defaults to pq\Result::$fetchType.
1111 * @throws \pq\Exception\InvalidArgumentException
1112 * @throws \pq\Exception\BadMethodCallException
1113 * @throws \pq\Exception\RuntimeException
1114 * @return array |object, the mapped columns.
1115 */
1116 function map($keys = 0, $vals = NULL, int $fetch_type = NULL) {}
1117 }
1118 /**
1119 * A named prepared statement.
1120 * See pq\Connection::prepare().
1121 */
1122 class Statement {
1123 /**
1124 * Prepare a new statement.
1125 * See pq\Connection::prepare().
1126 *
1127 * @param \pq\Connection $conn The connection to prepare the statement on.
1128 * @param string $name The name identifying this statement.
1129 * @param string $query The actual query to prepare.
1130 * @param array $types A list of corresponding query parameter type OIDs.
1131 * @param bool $async Whether to prepare the statement [asynchronously](pq/Connection/: Asynchronous Usage).
1132 * @throws \pq\Exception\InvalidArgumentException
1133 * @throws \pq\Exception\BadMethodCallException
1134 * @throws \pq\Exception\RuntimeException
1135 * @throws \pq\Exception\DomainException
1136 */
1137 function __construct(\pq\Connection $conn, string $name, string $query, array $types = NULL, bool $async = FALSE) {}
1138 /**
1139 * Bind a variable to an input parameter.
1140 *
1141 * @param int $param_no The parameter index to bind to.
1142 * @param mixed $param_ref The variable to bind.
1143 * @throws \pq\Exception\InvalidArgumentException
1144 * @throws \pq\Exception\BadMethodCallException
1145 */
1146 function bind(int $param_no, &$param_ref) {}
1147 /**
1148 * Free the server resources used by the prepared statement, so it can no longer be executed.
1149 * This is done implicitly when the object is destroyed.
1150 *
1151 * @throws \pq\Exception\InvalidArgumentException
1152 * @throws \pq\Exception\BadMethodCallException
1153 * @throws \pq\Exception\RuntimeException
1154 */
1155 function deallocate() {}
1156 /**
1157 * [Asynchronously](pq/Connection/: Asynchronous Usage) free the server resources used by the
1158 * prepared statement, so it can no longer be executed.
1159 *
1160 * @throws \pq\Exception\InvalidArgumentException
1161 * @throws \pq\Exception\BadMethodCallException
1162 * @throws \pq\Exception\RuntimeException
1163 */
1164 function deallocateAsync() {}
1165 /**
1166 * Describe the parameters of the prepared statement.
1167 *
1168 * @throws \pq\Exception\InvalidArgumentException
1169 * @throws \pq\Exception\BadMethodCallException
1170 * @throws \pq\Exception\RuntimeException
1171 * @throws \pq\Exception\DomainException
1172 * @return array list of type OIDs of the substitution parameters.
1173 */
1174 function desc() {}
1175 /**
1176 * [Asynchronously](pq/Connection/: Asynchronous Usage) describe the parameters of the prepared statement.
1177 *
1178 * @param callable $callback as function(array $oids)
1179 * A callback to receive list of type OIDs of the substitution parameters.
1180 * @throws \pq\Exception\InvalidArgumentException
1181 * @throws \pq\Exception\BadMethodCallException
1182 * @throws \pq\Exception\RuntimeException
1183 */
1184 function descAsync(callable $callback) {}
1185 /**
1186 * Execute the prepared statement.
1187 *
1188 * @param array $params Any parameters to substitute in the prepared statement (defaults to any bou
1189 * nd variables).
1190 * @throws \pq\Exception\InvalidArgumentException
1191 * @throws \pq\Exception\BadMethodCallException
1192 * @throws \pq\Exception\RuntimeException
1193 * @return \pq\Result the result of the execution of the prepared statement.
1194 */
1195 function exec(array $params = NULL) {}
1196 /**
1197 * [Asynchronously](pq/Connection/: Asynchronous Usage) execute the prepared statement.
1198 *
1199 * @param array $params Any parameters to substitute in the prepared statement (defaults to any bou
1200 * nd variables).
1201 * @param callable $cb as function(\pq\Result $res) : void
1202 * Result handler callback.
1203 * @throws \pq\Exception\InvalidArgumentException
1204 * @throws \pq\Exception\BadMethodCallException
1205 * @throws \pq\Exception\RuntimeException
1206 */
1207 function execAsync(array $params = NULL, callable $cb = NULL) {}
1208 /**
1209 * Re-prepare a statement that has been deallocated. This is a no-op on already open statements.
1210 *
1211 * @throws \pq\Exception\InvalidArgumentException
1212 * @throws \pq\Exception\BadMethodCallException
1213 * @throws \pq\Exception\RuntimeException
1214 */
1215 function prepare() {}
1216 /**
1217 * [Asynchronously](pq/Connection/: Asynchronous Usage) re-prepare a statement that has been
1218 * deallocated. This is a no-op on already open statements.
1219 *
1220 * @throws \pq\Exception\InvalidArgumentException
1221 * @throws \pq\Exception\BadMethodCallException
1222 * @throws \pq\Exception\RuntimeException
1223 */
1224 function prepareAsync() {}
1225 }
1226 /**
1227 * A database transaction.
1228 *
1229 * > ***NOTE:***
1230 * Transactional properties like pq\Transaction::$isolation, pq\Transaction::$readonly and pq\Transaction::$deferrable can be changed after the transaction begun and the first query has been executed. Doing this will lead to appropriate `SET TRANSACTION` queries.
1231 */
1232 class Transaction {
1233 /**
1234 * Transaction isolation level where only rows committed before the transaction began can be seen.
1235 */
1236 const READ_COMMITTED = 0;
1237 /**
1238 * Transaction isolation level where only rows committed before the first query was executed in this transaction.
1239 */
1240 const REPEATABLE_READ = 1;
1241 /**
1242 * Transaction isolation level that guarantees serializable repeatability which might lead to serialization_failure on high concurrency.
1243 */
1244 const SERIALIZABLE = 2;
1245 /**
1246 * The transaction isolation level.
1247 *
1248 * @public
1249 * @var int
1250 */
1251 public $isolation = \pq\Transaction::READ_COMMITTED;
1252 /**
1253 * Whether this transaction performs read only queries.
1254 *
1255 * @public
1256 * @var bool
1257 */
1258 public $readonly = FALSE;
1259 /**
1260 * Whether the transaction is deferrable. See pq\Connection::startTransaction().
1261 *
1262 * @public
1263 * @var bool
1264 */
1265 public $deferrable = FALSE;
1266 /**
1267 * Start a transaction.
1268 * See pq\Connection::startTransaction().
1269 *
1270 * @param \pq\Connection $conn The connection to start the transaction on.
1271 * @param bool $async Whether to start the transaction [asynchronously](pq/Connection/: Asynchronous Usage).
1272 * @param int $isolation The transaction isolation level (defaults to pq\Connection::$defaultTransactionIsolation).
1273 * @param bool $readonly Whether the transaction is readonly (defaults to pq\Connection::$defaultTransactionReadonly).
1274 * @param bool $deferrable Whether the transaction is deferrable (defaults to pq\Connection::$defaultTransactionDeferrable).
1275 * @throws \pq\Exception\InvalidArgumentException
1276 * @throws \pq\Exception\BadMethodCallException
1277 * @throws \pq\Exception\RuntimeException
1278 */
1279 function __construct(\pq\Connection $conn, bool $async = FALSE, int $isolation = \pq\Transaction::READ_COMMITTED, bool $readonly = FALSE, bool $deferrable = FALSE) {}
1280 /**
1281 * Commit the transaction or release the previous savepoint.
1282 * See pq\Transaction::savepoint().
1283 *
1284 * @throws \pq\Exception\InvalidArgumentException
1285 * @throws \pq\Exception\BadMethodCallException
1286 * @throws \pq\Exception\RuntimeException
1287 * @throws \pq\Exception\DomainException
1288 */
1289 function commit() {}
1290 /**
1291 * [Asynchronously](pq/Connection/: Asynchronous Usage) commit the transaction or release the previous savepoint.
1292 * See pq\Transaction::commit() and pq\Transaction::savepoint().
1293 *
1294 * @throws \pq\Exception\InvalidArgumentException
1295 * @throws \pq\Exception\BadMethodCallException
1296 * @throws \pq\Exception\RuntimeException
1297 */
1298 function commitAsync() {}
1299 /**
1300 * Create a new *large object* and open it.
1301 * See pq\Transaction::openLOB().
1302 *
1303 * @param int $mode How to open the *large object* (read, write or both; see pq\LOB constants).
1304 * @throws \pq\Exception\InvalidArgumentException
1305 * @throws \pq\Exception\BadMethodCallException
1306 * @throws \pq\Exception\RuntimeException
1307 * @return \pq\LOB instance of the new *large object*.
1308 */
1309 function createLOB(int $mode = \pq\LOB::RW) {}
1310 /**
1311 * Export a *large object* to a local file.
1312 * See pq\Transaction::importLOB().
1313 *
1314 * @param int $oid The OID of the *large object*.
1315 * @param string $path The path of a local file to export to.
1316 * @throws \pq\Exception\InvalidArgumentException
1317 * @throws \pq\Exception\BadMethodCallException
1318 * @throws \pq\Exception\RuntimeException
1319 */
1320 function exportLOB(int $oid, string $path) {}
1321 /**
1322 * Export a snapshot for transaction synchronization.
1323 * See pq\Transaction::importSnapshot().
1324 *
1325 * @throws \pq\Exception\InvalidArgumentException
1326 * @throws \pq\Exception\BadMethodCallException
1327 * @throws \pq\Exception\RuntimeException
1328 * @throws \pq\Exception\DomainException
1329 * @return string the snapshot identifier usable with pq\Transaction::importSnapshot().
1330 */
1331 function exportSnapshot() {}
1332 /**
1333 * [Asynchronously](pq/Connection/: Asynchronous Usage) export a snapshot for transaction synchronization.
1334 * See pq\Transaction::exportSnapshot().
1335 *
1336 * @throws \pq\Exception\InvalidArgumentException
1337 * @throws \pq\Exception\BadMethodCallException
1338 * @throws \pq\Exception\RuntimeException
1339 */
1340 function exportSnapshotAsync() {}
1341 /**
1342 * Import a local file into a *large object*.
1343 *
1344 * @param string $local_path A path to a local file to import.
1345 * @param int $oid The target OID. A new *large object* will be created if INVALID_OID.
1346 * @throws \pq\Exception\InvalidArgumentException
1347 * @throws \pq\Exception\BadMethodCallException
1348 * @throws \pq\Exception\RuntimeException
1349 * @return int the (new) OID of the *large object*.
1350 */
1351 function importLOB(string $local_path, int $oid = \pq\LOB::INVALID_OID) {}
1352 /**
1353 * Import a snapshot from another transaction to synchronize with.
1354 * See pq\Transaction::exportSnapshot().
1355 *
1356 * > ***NOTE:***
1357 * The transaction must have an isolation level of at least pq\Transaction::REPEATABLE_READ.
1358 *
1359 * @param string $snapshot_id The snapshot identifier obtained by exporting a snapshot from a transaction.
1360 * @throws \pq\Exception\InvalidArgumentException
1361 * @throws \pq\Exception\BadMethodCallException
1362 * @throws \pq\Exception\RuntimeException
1363 * @throws \pq\Exception\DomainException
1364 */
1365 function importSnapshot(string $snapshot_id) {}
1366 /**
1367 * [Asynchronously](pq/Connection/: Asynchronous Usage) import a snapshot from another transaction to synchronize with.
1368 * See pq\Transaction::importSnapshot().
1369 *
1370 * > ***NOTE:***
1371 * The transaction must have an isolation level of at least pq\Transaction::REPEATABLE_READ.
1372 *
1373 * @param string $snapshot_id The snapshot identifier obtained by exporting a snapshot from a transaction.
1374 * @throws \pq\Exception\InvalidArgumentException
1375 * @throws \pq\Exception\BadMethodCallException
1376 * @throws \pq\Exception\RuntimeException
1377 */
1378 function importSnapshotAsync(string $snapshot_id) {}
1379 /**
1380 * Open a *large object*.
1381 * See pq\Transaction::createLOB().
1382 *
1383 * @param int $oid The OID of the *large object*.
1384 * @param int $mode Operational mode; read, write or both.
1385 * @throws \pq\Exception\InvalidArgumentException
1386 * @throws \pq\Exception\BadMethodCallException
1387 * @throws \pq\Exception\RuntimeException
1388 * @return \pq\LOB instance of the opened *large object*.
1389 */
1390 function openLOB(int $oid, int $mode = \pq\LOB::RW) {}
1391 /**
1392 * Rollback the transaction or to the previous savepoint within this transaction.
1393 * See pq\Transaction::commit() and pq\Transaction::savepoint().
1394 *
1395 * @throws \pq\Exception\InvalidArgumentException
1396 * @throws \pq\Exception\BadMethodCallException
1397 * @throws \pq\Exception\RuntimeException
1398 * @throws \pq\Exception\DomainException
1399 */
1400 function rollback() {}
1401 /**
1402 * [Asynchronously](pq/Connection/: Asynchronous Usage) rollback the transaction or to the previous savepoint within this transaction.
1403 * See pq\Transaction::rollback() and pq\Transaction::savepoint().
1404 *
1405 * @throws \pq\Exception\InvalidArgumentException
1406 * @throws \pq\Exception\BadMethodCallException
1407 * @throws \pq\Exception\RuntimeException
1408 */
1409 function rollbackAsync() {}
1410 /**
1411 * Create a `SAVEPOINT` within this transaction.
1412 *
1413 * > ***NOTE:***
1414 * pq\Transaction tracks an internal counter as savepoint identifier.
1415 *
1416 * @throws \pq\Exception\InvalidArgumentException
1417 * @throws \pq\Exception\BadMethodCallException
1418 * @throws \pq\Exception\RuntimeException
1419 */
1420 function savepoint() {}
1421 /**
1422 * [Asynchronously](pq/Connection/: Asynchronous Usage) create a `SAVEPOINT` within this transaction.
1423 * See pq\Transaction::savepoint().
1424 *
1425 * @throws \pq\Exception\InvalidArgumentException
1426 * @throws \pq\Exception\BadMethodCallException
1427 * @throws \pq\Exception\RuntimeException
1428 */
1429 function savepointAsync() {}
1430 /**
1431 * Unlink a *large object*.
1432 * See pq\Transaction::createLOB().
1433 *
1434 * @param int $oid The OID of the *large object*.
1435 * @throws \pq\Exception\InvalidArgumentException
1436 * @throws \pq\Exception\BadMethodCallException
1437 * @throws \pq\Exception\RuntimeException
1438 * @return \pq\LOB instance of the opened *large object*.
1439 */
1440 function unlinkLOB(int $oid) {}
1441 }
1442 /**
1443 * Accessor to the PostgreSQL `pg_type` relation.
1444 * See [here for an overview](pq/Types/: Overview).
1445 */
1446 class Types implements \ArrayAccess {
1447 /**
1448 * OID of the `bool` type.
1449 */
1450 const BOOL = 16;
1451 /**
1452 * OID of the `bytea` type.
1453 */
1454 const BYTEA = 17;
1455 /**
1456 * OID of the `char` type.
1457 */
1458 const CHAR = 18;
1459 /**
1460 * OID of the `name` type.
1461 */
1462 const NAME = 19;
1463 /**
1464 * OID of the `int8` type.
1465 */
1466 const INT8 = 20;
1467 /**
1468 * OID of the `int2` type.
1469 */
1470 const INT2 = 21;
1471 /**
1472 * OID of the `int2vector` type.
1473 */
1474 const INT2VECTOR = 22;
1475 /**
1476 * OID of the `int4` type.
1477 */
1478 const INT4 = 23;
1479 /**
1480 * OID of the `regproc` type.
1481 */
1482 const REGPROC = 24;
1483 /**
1484 * OID of the `text` type.
1485 */
1486 const TEXT = 25;
1487 /**
1488 * OID of the `oid` type.
1489 */
1490 const OID = 26;
1491 /**
1492 * OID of the `tid` type.
1493 */
1494 const TID = 27;
1495 /**
1496 * OID of the `xid` type.
1497 */
1498 const XID = 28;
1499 /**
1500 * OID of the `cid` type.
1501 */
1502 const CID = 29;
1503 /**
1504 * OID of the `oidvector` type.
1505 */
1506 const OIDVECTOR = 30;
1507 /**
1508 * OID of the `pg_type` type.
1509 */
1510 const PG_TYPE = 71;
1511 /**
1512 * OID of the `pg_attribute` type.
1513 */
1514 const PG_ATTRIBUTE = 75;
1515 /**
1516 * OID of the `pg_proc` type.
1517 */
1518 const PG_PROC = 81;
1519 /**
1520 * OID of the `pg_class` type.
1521 */
1522 const PG_CLASS = 83;
1523 /**
1524 * OID of the `json` type.
1525 */
1526 const JSON = 114;
1527 /**
1528 * OID of the `xml` type.
1529 */
1530 const XML = 142;
1531 /**
1532 * OID of the `xmlarray` type.
1533 */
1534 const XMLARRAY = 143;
1535 /**
1536 * OID of the `jsonarray` type.
1537 */
1538 const JSONARRAY = 199;
1539 /**
1540 * OID of the `pg_node_tree` type.
1541 */
1542 const PG_NODE_TREE = 194;
1543 /**
1544 * OID of the `smgr` type.
1545 */
1546 const SMGR = 210;
1547 /**
1548 * OID of the `point` type.
1549 */
1550 const POINT = 600;
1551 /**
1552 * OID of the `lseg` type.
1553 */
1554 const LSEG = 601;
1555 /**
1556 * OID of the `path` type.
1557 */
1558 const PATH = 602;
1559 /**
1560 * OID of the `box` type.
1561 */
1562 const BOX = 603;
1563 /**
1564 * OID of the `polygon` type.
1565 */
1566 const POLYGON = 604;
1567 /**
1568 * OID of the `line` type.
1569 */
1570 const LINE = 628;
1571 /**
1572 * OID of the `linearray` type.
1573 */
1574 const LINEARRAY = 629;
1575 /**
1576 * OID of the `float4` type.
1577 */
1578 const FLOAT4 = 700;
1579 /**
1580 * OID of the `float8` type.
1581 */
1582 const FLOAT8 = 701;
1583 /**
1584 * OID of the `abstime` type.
1585 */
1586 const ABSTIME = 702;
1587 /**
1588 * OID of the `reltime` type.
1589 */
1590 const RELTIME = 703;
1591 /**
1592 * OID of the `tinterval` type.
1593 */
1594 const TINTERVAL = 704;
1595 /**
1596 * OID of the `unknown` type.
1597 */
1598 const UNKNOWN = 705;
1599 /**
1600 * OID of the `circle` type.
1601 */
1602 const CIRCLE = 718;
1603 /**
1604 * OID of the `circlearray` type.
1605 */
1606 const CIRCLEARRAY = 719;
1607 /**
1608 * OID of the `money` type.
1609 */
1610 const MONEY = 790;
1611 /**
1612 * OID of the `moneyarray` type.
1613 */
1614 const MONEYARRAY = 791;
1615 /**
1616 * OID of the `macaddr` type.
1617 */
1618 const MACADDR = 829;
1619 /**
1620 * OID of the `inet` type.
1621 */
1622 const INET = 869;
1623 /**
1624 * OID of the `cidr` type.
1625 */
1626 const CIDR = 650;
1627 /**
1628 * OID of the `boolarray` type.
1629 */
1630 const BOOLARRAY = 1000;
1631 /**
1632 * OID of the `byteaarray` type.
1633 */
1634 const BYTEAARRAY = 1001;
1635 /**
1636 * OID of the `chararray` type.
1637 */
1638 const CHARARRAY = 1002;
1639 /**
1640 * OID of the `namearray` type.
1641 */
1642 const NAMEARRAY = 1003;
1643 /**
1644 * OID of the `int2array` type.
1645 */
1646 const INT2ARRAY = 1005;
1647 /**
1648 * OID of the `int2vectorarray` type.
1649 */
1650 const INT2VECTORARRAY = 1006;
1651 /**
1652 * OID of the `int4array` type.
1653 */
1654 const INT4ARRAY = 1007;
1655 /**
1656 * OID of the `regprocarray` type.
1657 */
1658 const REGPROCARRAY = 1008;
1659 /**
1660 * OID of the `textarray` type.
1661 */
1662 const TEXTARRAY = 1009;
1663 /**
1664 * OID of the `oidarray` type.
1665 */
1666 const OIDARRAY = 1028;
1667 /**
1668 * OID of the `tidarray` type.
1669 */
1670 const TIDARRAY = 1010;
1671 /**
1672 * OID of the `xidarray` type.
1673 */
1674 const XIDARRAY = 1011;
1675 /**
1676 * OID of the `cidarray` type.
1677 */
1678 const CIDARRAY = 1012;
1679 /**
1680 * OID of the `oidvectorarray` type.
1681 */
1682 const OIDVECTORARRAY = 1013;
1683 /**
1684 * OID of the `bpchararray` type.
1685 */
1686 const BPCHARARRAY = 1014;
1687 /**
1688 * OID of the `varchararray` type.
1689 */
1690 const VARCHARARRAY = 1015;
1691 /**
1692 * OID of the `int8array` type.
1693 */
1694 const INT8ARRAY = 1016;
1695 /**
1696 * OID of the `pointarray` type.
1697 */
1698 const POINTARRAY = 1017;
1699 /**
1700 * OID of the `lsegarray` type.
1701 */
1702 const LSEGARRAY = 1018;
1703 /**
1704 * OID of the `patharray` type.
1705 */
1706 const PATHARRAY = 1019;
1707 /**
1708 * OID of the `boxarray` type.
1709 */
1710 const BOXARRAY = 1020;
1711 /**
1712 * OID of the `float4array` type.
1713 */
1714 const FLOAT4ARRAY = 1021;
1715 /**
1716 * OID of the `float8array` type.
1717 */
1718 const FLOAT8ARRAY = 1022;
1719 /**
1720 * OID of the `abstimearray` type.
1721 */
1722 const ABSTIMEARRAY = 1023;
1723 /**
1724 * OID of the `reltimearray` type.
1725 */
1726 const RELTIMEARRAY = 1024;
1727 /**
1728 * OID of the `tintervalarray` type.
1729 */
1730 const TINTERVALARRAY = 1025;
1731 /**
1732 * OID of the `polygonarray` type.
1733 */
1734 const POLYGONARRAY = 1027;
1735 /**
1736 * OID of the `aclitem` type.
1737 */
1738 const ACLITEM = 1033;
1739 /**
1740 * OID of the `aclitemarray` type.
1741 */
1742 const ACLITEMARRAY = 1034;
1743 /**
1744 * OID of the `macaddrarray` type.
1745 */
1746 const MACADDRARRAY = 1040;
1747 /**
1748 * OID of the `inetarray` type.
1749 */
1750 const INETARRAY = 1041;
1751 /**
1752 * OID of the `cidrarray` type.
1753 */
1754 const CIDRARRAY = 651;
1755 /**
1756 * OID of the `cstringarray` type.
1757 */
1758 const CSTRINGARRAY = 1263;
1759 /**
1760 * OID of the `bpchar` type.
1761 */
1762 const BPCHAR = 1042;
1763 /**
1764 * OID of the `varchar` type.
1765 */
1766 const VARCHAR = 1043;
1767 /**
1768 * OID of the `date` type.
1769 */
1770 const DATE = 1082;
1771 /**
1772 * OID of the `time` type.
1773 */
1774 const TIME = 1083;
1775 /**
1776 * OID of the `timestamp` type.
1777 */
1778 const TIMESTAMP = 1114;
1779 /**
1780 * OID of the `timestamparray` type.
1781 */
1782 const TIMESTAMPARRAY = 1115;
1783 /**
1784 * OID of the `datearray` type.
1785 */
1786 const DATEARRAY = 1182;
1787 /**
1788 * OID of the `timearray` type.
1789 */
1790 const TIMEARRAY = 1183;
1791 /**
1792 * OID of the `timestamptz` type.
1793 */
1794 const TIMESTAMPTZ = 1184;
1795 /**
1796 * OID of the `timestamptzarray` type.
1797 */
1798 const TIMESTAMPTZARRAY = 1185;
1799 /**
1800 * OID of the `interval` type.
1801 */
1802 const INTERVAL = 1186;
1803 /**
1804 * OID of the `intervalarray` type.
1805 */
1806 const INTERVALARRAY = 1187;
1807 /**
1808 * OID of the `numericarray` type.
1809 */
1810 const NUMERICARRAY = 1231;
1811 /**
1812 * OID of the `timetz` type.
1813 */
1814 const TIMETZ = 1266;
1815 /**
1816 * OID of the `timetzarray` type.
1817 */
1818 const TIMETZARRAY = 1270;
1819 /**
1820 * OID of the `bit` type.
1821 */
1822 const BIT = 1560;
1823 /**
1824 * OID of the `bitarray` type.
1825 */
1826 const BITARRAY = 1561;
1827 /**
1828 * OID of the `varbit` type.
1829 */
1830 const VARBIT = 1562;
1831 /**
1832 * OID of the `varbitarray` type.
1833 */
1834 const VARBITARRAY = 1563;
1835 /**
1836 * OID of the `numeric` type.
1837 */
1838 const NUMERIC = 1700;
1839 /**
1840 * OID of the `refcursor` type.
1841 */
1842 const REFCURSOR = 1790;
1843 /**
1844 * OID of the `refcursorarray` type.
1845 */
1846 const REFCURSORARRAY = 2201;
1847 /**
1848 * OID of the `regprocedure` type.
1849 */
1850 const REGPROCEDURE = 2202;
1851 /**
1852 * OID of the `regoper` type.
1853 */
1854 const REGOPER = 2203;
1855 /**
1856 * OID of the `regoperator` type.
1857 */
1858 const REGOPERATOR = 2204;
1859 /**
1860 * OID of the `regclass` type.
1861 */
1862 const REGCLASS = 2205;
1863 /**
1864 * OID of the `regtype` type.
1865 */
1866 const REGTYPE = 2206;
1867 /**
1868 * OID of the `regprocedurearray` type.
1869 */
1870 const REGPROCEDUREARRAY = 2207;
1871 /**
1872 * OID of the `regoperarray` type.
1873 */
1874 const REGOPERARRAY = 2208;
1875 /**
1876 * OID of the `regoperatorarray` type.
1877 */
1878 const REGOPERATORARRAY = 2209;
1879 /**
1880 * OID of the `regclassarray` type.
1881 */
1882 const REGCLASSARRAY = 2210;
1883 /**
1884 * OID of the `regtypearray` type.
1885 */
1886 const REGTYPEARRAY = 2211;
1887 /**
1888 * OID of the `uuid` type.
1889 */
1890 const UUID = 2950;
1891 /**
1892 * OID of the `uuidarray` type.
1893 */
1894 const UUIDARRAY = 2951;
1895 /**
1896 * OID of the `tsvector` type.
1897 */
1898 const TSVECTOR = 3614;
1899 /**
1900 * OID of the `gtsvector` type.
1901 */
1902 const GTSVECTOR = 3642;
1903 /**
1904 * OID of the `tsquery` type.
1905 */
1906 const TSQUERY = 3615;
1907 /**
1908 * OID of the `regconfig` type.
1909 */
1910 const REGCONFIG = 3734;
1911 /**
1912 * OID of the `regdictionary` type.
1913 */
1914 const REGDICTIONARY = 3769;
1915 /**
1916 * OID of the `tsvectorarray` type.
1917 */
1918 const TSVECTORARRAY = 3643;
1919 /**
1920 * OID of the `gtsvectorarray` type.
1921 */
1922 const GTSVECTORARRAY = 3644;
1923 /**
1924 * OID of the `tsqueryarray` type.
1925 */
1926 const TSQUERYARRAY = 3645;
1927 /**
1928 * OID of the `regconfigarray` type.
1929 */
1930 const REGCONFIGARRAY = 3735;
1931 /**
1932 * OID of the `regdictionaryarray` type.
1933 */
1934 const REGDICTIONARYARRAY = 3770;
1935 /**
1936 * OID of the `txid_snapshot` type.
1937 */
1938 const TXID_SNAPSHOT = 2970;
1939 /**
1940 * OID of the `txid_snapshotarray` type.
1941 */
1942 const TXID_SNAPSHOTARRAY = 2949;
1943 /**
1944 * OID of the `int4range` type.
1945 */
1946 const INT4RANGE = 3904;
1947 /**
1948 * OID of the `int4rangearray` type.
1949 */
1950 const INT4RANGEARRAY = 3905;
1951 /**
1952 * OID of the `numrange` type.
1953 */
1954 const NUMRANGE = 3906;
1955 /**
1956 * OID of the `numrangearray` type.
1957 */
1958 const NUMRANGEARRAY = 3907;
1959 /**
1960 * OID of the `tsrange` type.
1961 */
1962 const TSRANGE = 3908;
1963 /**
1964 * OID of the `tsrangearray` type.
1965 */
1966 const TSRANGEARRAY = 3909;
1967 /**
1968 * OID of the `tstzrange` type.
1969 */
1970 const TSTZRANGE = 3910;
1971 /**
1972 * OID of the `tstzrangearray` type.
1973 */
1974 const TSTZRANGEARRAY = 3911;
1975 /**
1976 * OID of the `daterange` type.
1977 */
1978 const DATERANGE = 3912;
1979 /**
1980 * OID of the `daterangearray` type.
1981 */
1982 const DATERANGEARRAY = 3913;
1983 /**
1984 * OID of the `int8range` type.
1985 */
1986 const INT8RANGE = 3926;
1987 /**
1988 * OID of the `int8rangearray` type.
1989 */
1990 const INT8RANGEARRAY = 3927;
1991 /**
1992 * OID of the `record` type.
1993 */
1994 const RECORD = 2249;
1995 /**
1996 * OID of the `recordarray` type.
1997 */
1998 const RECORDARRAY = 2287;
1999 /**
2000 * OID of the `cstring` type.
2001 */
2002 const CSTRING = 2275;
2003 /**
2004 * OID of the `any` type.
2005 */
2006 const ANY = 2276;
2007 /**
2008 * OID of the `anyarray` type.
2009 */
2010 const ANYARRAY = 2277;
2011 /**
2012 * OID of the `void` type.
2013 */
2014 const VOID = 2278;
2015 /**
2016 * OID of the `trigger` type.
2017 */
2018 const TRIGGER = 2279;
2019 /**
2020 * OID of the `event_trigger` type.
2021 */
2022 const EVENT_TRIGGER = 3838;
2023 /**
2024 * OID of the `language_handler` type.
2025 */
2026 const LANGUAGE_HANDLER = 2280;
2027 /**
2028 * OID of the `internal` type.
2029 */
2030 const INTERNAL = 2281;
2031 /**
2032 * OID of the `opaque` type.
2033 */
2034 const OPAQUE = 2282;
2035 /**
2036 * OID of the `anyelement` type.
2037 */
2038 const ANYELEMENT = 2283;
2039 /**
2040 * OID of the `anynonarray` type.
2041 */
2042 const ANYNONARRAY = 2776;
2043 /**
2044 * OID of the `anyenum` type.
2045 */
2046 const ANYENUM = 3500;
2047 /**
2048 * OID of the `fdw_handler` type.
2049 */
2050 const FDW_HANDLER = 3115;
2051 /**
2052 * OID of the `anyrange` type.
2053 */
2054 const ANYRANGE = 3831;
2055 /**
2056 * Create a new instance populated with information obtained from the `pg_type` relation.
2057 *
2058 * @param \pq\Connection $conn The connection to use.
2059 * @param array $namespaces Which namespaces to query (defaults to `public` and `pg_catalog`).
2060 * @throws \pq\Exception\InvalidArgumentException
2061 * @throws \pq\Exception\BadMethodCallException
2062 * @throws \pq\Exception\RuntimeException
2063 */
2064 function __construct(\pq\Connection $conn, array $namespaces = NULL) {}
2065 /**
2066 * Refresh type information from `pg_type`.
2067 *
2068 * @param array $namespaces Which namespaces to query (defaults to `public` and `pg_catalog`).
2069 * @throws \pq\Exception\InvalidArgumentException
2070 * @throws \pq\Exception\BadMethodCallException
2071 * @throws \pq\Exception\RuntimeException
2072 */
2073 function refresh(array $namespaces = NULL) {}
2074 }
2075 namespace pq\Exception;
2076 /**
2077 * A method call was not expected.
2078 */
2079 class BadMethodCallException extends \BadMethodCallException implements \pq\Exception {
2080 }
2081 /**
2082 * Implementation or SQL syntax error.
2083 */
2084 class DomainException extends \DomainException implements \pq\Exception {
2085 }
2086 /**
2087 * An invalid argument was passed to a method.
2088 */
2089 class InvalidArgumentException extends \InvalidArgumentException implements \pq\Exception {
2090 }
2091 /**
2092 * A runtime exception occurred.
2093 */
2094 class RuntimeException extends \RuntimeException implements \pq\Exception {
2095 }