xref: /PHP-8.1/ext/pgsql/pgsql.stub.php (revision ca219d7d)
1<?php
2
3/** @generate-class-entries */
4
5namespace PgSql {
6
7    /**
8     * @strict-properties
9     * @not-serializable
10     */
11    final class Connection
12    {
13    }
14
15    /**
16     * @strict-properties
17     * @not-serializable
18     */
19    final class Result
20    {
21    }
22
23    /**
24     * @strict-properties
25     * @not-serializable
26     */
27    final class Lob
28    {
29    }
30
31}
32
33namespace {
34
35    function pg_connect(string $connection_string, int $flags = 0): PgSql\Connection|false {}
36
37    function pg_pconnect(string $connection_string, int $flags = 0): PgSql\Connection|false {}
38
39    function pg_connect_poll(PgSql\Connection $connection): int {}
40
41    function pg_close(?PgSql\Connection $connection = null): bool {}
42
43    /** @refcount 1 */
44    function pg_dbname(?PgSql\Connection $connection = null): string {}
45
46    function pg_last_error(?PgSql\Connection $connection = null): string {}
47
48    /**
49     * @alias pg_last_error
50     * @deprecated
51     */
52    function pg_errormessage(?PgSql\Connection $connection = null): string {}
53
54    /** @refcount 1 */
55    function pg_options(?PgSql\Connection $connection = null): string {}
56
57    /** @refcount 1 */
58    function pg_port(?PgSql\Connection $connection = null): string {}
59
60    /** @refcount 1 */
61    function pg_tty(?PgSql\Connection $connection = null): string {}
62
63    /** @refcount 1 */
64    function pg_host(?PgSql\Connection $connection = null): string {}
65
66    /**
67     * @return array<string, int|string|null>
68     * @refcount 1
69     */
70    function pg_version(?PgSql\Connection $connection = null): array {}
71
72    /**
73     * @param PgSql\Connection|string $connection
74     * @refcount 1
75     */
76    function pg_parameter_status($connection, string $name = UNKNOWN): string|false {}
77
78    function pg_ping(?PgSql\Connection $connection = null): bool {}
79
80    /**
81     * @param PgSql\Connection|string $connection
82     * @refcount 1
83     */
84    function pg_query($connection, string $query = UNKNOWN): PgSql\Result|false {}
85
86    /**
87     * @param PgSql\Connection|string $connection
88     * @alias pg_query
89     */
90    function pg_exec($connection, string $query = UNKNOWN): PgSql\Result|false {}
91
92    /**
93     * @param PgSql\Connection|string $connection
94     * @param string|array $query
95     * @refcount 1
96     */
97    function pg_query_params($connection, $query, array $params = UNKNOWN): PgSql\Result|false {}
98
99    /**
100     * @param PgSql\Connection|string $connection
101     * @refcount 1
102     */
103    function pg_prepare($connection, string $statement_name, string $query = UNKNOWN): PgSql\Result|false {}
104
105    /**
106     * @param PgSql\Connection|string $connection
107     * @param string|array $statement_name
108     * @refcount 1
109     */
110    function pg_execute($connection, $statement_name, array $params = UNKNOWN): PgSql\Result|false {}
111
112    function pg_num_rows(PgSql\Result $result): int {}
113
114    /**
115     * @alias pg_num_rows
116     * @deprecated
117     */
118    function pg_numrows(PgSql\Result $result): int {}
119
120    function pg_num_fields(PgSql\Result $result): int {}
121
122    /**
123     * @alias pg_num_fields
124     * @deprecated
125     */
126    function pg_numfields(PgSql\Result $result): int {}
127
128    function pg_affected_rows(PgSql\Result $result): int {}
129
130    /**
131     * @alias pg_affected_rows
132     * @deprecated
133     */
134    function pg_cmdtuples(PgSql\Result $result): int {}
135
136    function pg_last_notice(PgSql\Connection $connection, int $mode = PGSQL_NOTICE_LAST): array|string|bool {}
137
138    function pg_field_table(PgSql\Result $result, int $field, bool $oid_only = false): string|int|false {}
139
140    /** @refcount 1 */
141    function pg_field_name(PgSql\Result $result, int $field): string {}
142
143    /**
144     * @alias pg_field_name
145     * @deprecated
146     */
147    function pg_fieldname(PgSql\Result $result, int $field): string {}
148
149    function pg_field_size(PgSql\Result $result, int $field): int {}
150
151    /**
152     * @alias pg_field_size
153     * @deprecated
154     */
155    function pg_fieldsize(PgSql\Result $result, int $field): int {}
156
157    function pg_field_type(PgSql\Result $result, int $field): string {}
158
159    /**
160     * @alias pg_field_type
161     * @deprecated
162     */
163    function pg_fieldtype(PgSql\Result $result, int $field): string {}
164
165    /** @refcount 1 */
166    function pg_field_type_oid(PgSql\Result $result, int $field): string|int {}
167
168    function pg_field_num(PgSql\Result $result, string $field): int {}
169
170    /**
171     * @alias pg_field_num
172     * @deprecated
173     */
174    function pg_fieldnum(PgSql\Result $result, string $field): int {}
175
176    /**
177     * @param string|int $row
178     * @refcount 1
179     */
180    function pg_fetch_result(PgSql\Result $result, $row, string|int $field = UNKNOWN): string|false|null {}
181
182    /**
183     * @param string|int $row
184     * @alias pg_fetch_result
185     * @deprecated
186     */
187    function pg_result(PgSql\Result $result, $row, string|int $field = UNKNOWN): string|false|null {}
188
189    /**
190     * @return array<int|string, string|null>|false
191     * @refcount 1
192     */
193    function pg_fetch_row(PgSql\Result $result, ?int $row = null, int $mode = PGSQL_NUM): array|false {}
194
195    /**
196     * @return array<int|string, string|null>|false
197     * @refcount 1
198     */
199    function pg_fetch_assoc(PgSql\Result $result, ?int $row = null): array|false {}
200
201    /**
202     * @return array<int|string, string|null>|false
203     * @refcount 1
204     */
205    function pg_fetch_array(PgSql\Result $result, ?int $row = null, int $mode = PGSQL_BOTH): array|false {}
206
207    /** @refcount 1 */
208    function pg_fetch_object(PgSql\Result $result, ?int $row = null, string $class = "stdClass", array $constructor_args = []): object|false {}
209
210    /**
211     * @return array<int, array>
212     * @refcount 1
213     */
214    function pg_fetch_all(PgSql\Result $result, int $mode = PGSQL_ASSOC): array {}
215
216    /**
217     * @return array<int, string|null>
218     * @refcount 1
219     */
220    function pg_fetch_all_columns(PgSql\Result $result, int $field = 0): array {}
221
222    function pg_result_seek(PgSql\Result $result, int $row): bool {}
223
224    /** @param string|int $row */
225    function pg_field_prtlen(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
226
227    /**
228     * @param string|int $row
229     * @alias pg_field_prtlen
230     * @deprecated
231     */
232    function pg_fieldprtlen(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
233
234    /** @param string|int $row */
235    function pg_field_is_null(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
236
237    /**
238     * @param string|int $row
239     * @alias pg_field_is_null
240     * @deprecated
241     */
242    function pg_fieldisnull(PgSql\Result $result, $row, string|int $field = UNKNOWN): int|false {}
243
244    function pg_free_result(PgSql\Result $result): bool {}
245
246    /**
247     * @alias pg_free_result
248     * @deprecated
249     */
250    function pg_freeresult(PgSql\Result $result): bool {}
251
252    /** @refcount 1 */
253    function pg_last_oid(PgSql\Result $result): string|int|false {}
254
255    /**
256     * @alias pg_last_oid
257     * @deprecated
258     */
259    function pg_getlastoid(PgSql\Result $result): string|int|false {}
260
261    function pg_trace(string $filename, string $mode = "w", ?PgSql\Connection $connection = null): bool {}
262
263    function pg_untrace(?PgSql\Connection $connection = null): bool {}
264
265    /**
266     * @param PgSql\Connection $connection
267     * @param string|int $oid
268     * @refcount 1
269     */
270    function pg_lo_create($connection = UNKNOWN, $oid = UNKNOWN): string|int|false {}
271
272    /**
273     * @param PgSql\Connection $connection
274     * @param string|int $oid
275     * @alias pg_lo_create
276     * @deprecated
277     */
278    function pg_locreate($connection = UNKNOWN, $oid = UNKNOWN): string|int|false {}
279
280    /**
281     * @param PgSql\Connection $connection
282     * @param string|int $oid
283     */
284    function pg_lo_unlink($connection, $oid = UNKNOWN): bool {}
285
286    /**
287     * @param PgSql\Connection $connection
288     * @param string|int $oid
289     * @alias pg_lo_unlink
290     * @deprecated
291     */
292    function pg_lounlink($connection, $oid = UNKNOWN): bool {}
293
294    /**
295     * @param PgSql\Connection $connection
296     * @param string|int $oid
297     * @refcount 1
298     */
299    function pg_lo_open($connection, $oid = UNKNOWN, string $mode = UNKNOWN): PgSql\Lob|false {}
300
301    /**
302     * @param PgSql\Connection $connection
303     * @param string|int $oid
304     * @alias pg_lo_open
305     * @deprecated
306     */
307    function pg_loopen($connection, $oid = UNKNOWN, string $mode = UNKNOWN): PgSql\Lob|false {}
308
309    function pg_lo_close(PgSql\Lob $lob): bool {}
310
311    /**
312     * @alias pg_lo_close
313     * @deprecated
314     */
315    function pg_loclose(PgSql\Lob $lob): bool {}
316
317    /** @refcount 1 */
318    function pg_lo_read(PgSql\Lob $lob, int $length = 8192): string|false {}
319
320    /**
321     * @alias pg_lo_read
322     * @deprecated
323     */
324    function pg_loread(PgSql\Lob $lob, int $length = 8192): string|false {}
325
326    function pg_lo_write(PgSql\Lob $lob, string $data, ?int $length = null): int|false {}
327
328    /**
329     * @alias pg_lo_write
330     * @deprecated
331     */
332    function pg_lowrite(PgSql\Lob $lob, string $data, ?int $length = null): int|false {}
333
334    function pg_lo_read_all(PgSql\Lob $lob): int {}
335
336    /**
337     * @alias pg_lo_read_all
338     * @deprecated
339     */
340    function pg_loreadall(PgSql\Lob $lob): int {}
341
342    /**
343     * @param PgSql\Connection|string $connection
344     * @param string|int $filename
345     * @param string|int $oid
346     * @refcount 1
347     */
348    function pg_lo_import($connection, $filename = UNKNOWN, $oid = UNKNOWN): string|int|false {}
349
350    /**
351     * @param PgSql\Connection|string $connection
352     * @param string|int $filename
353     * @param string|int $oid
354     * @alias pg_lo_import
355     * @deprecated
356     */
357    function pg_loimport($connection, $filename = UNKNOWN, $oid = UNKNOWN): string|int|false {}
358
359    /**
360     * @param PgSql\Connection|string|int $connection
361     * @param string|int $oid
362     * @param string|int $filename
363     */
364    function pg_lo_export($connection, $oid = UNKNOWN, $filename = UNKNOWN): bool {}
365
366    /**
367     * @param PgSql\Connection|string|int $connection
368     * @param string|int $oid
369     * @param string|int $filename
370     * @alias pg_lo_export
371     * @deprecated
372     */
373    function pg_loexport($connection, $oid = UNKNOWN, $filename = UNKNOWN): bool {}
374
375    function pg_lo_seek(PgSql\Lob $lob, int $offset, int $whence = SEEK_CUR): bool {}
376
377    function pg_lo_tell(PgSql\Lob $lob): int {}
378
379    function pg_lo_truncate(PgSql\Lob $lob, int $size): bool {}
380
381    /** @param PgSql\Connection|int $connection */
382    function pg_set_error_verbosity($connection, int $verbosity = UNKNOWN): int|false {}
383
384    /** @param PgSql\Connection|string $connection */
385    function pg_set_client_encoding($connection, string $encoding = UNKNOWN): int {}
386
387    /**
388     * @param PgSql\Connection|string $connection
389     * @alias pg_set_client_encoding
390     * @deprecated
391     */
392    function pg_setclientencoding($connection, string $encoding = UNKNOWN): int {}
393
394    function pg_client_encoding(?PgSql\Connection $connection = null): string {}
395
396    /**
397     * @alias pg_client_encoding
398     * @deprecated
399     */
400    function pg_clientencoding(?PgSql\Connection $connection = null): string {}
401
402    function pg_end_copy(?PgSql\Connection $connection = null): bool {}
403
404    /** @param PgSql\Connection|string $connection */
405    function pg_put_line($connection, string $query = UNKNOWN): bool {}
406
407    /**
408     * @return array<int, string>|false
409     * @refcount 1
410     */
411    function pg_copy_to(PgSql\Connection $connection, string $table_name, string $separator = "\t", string $null_as = "\\\\N"): array|false {}
412
413    function pg_copy_from(PgSql\Connection $connection, string $table_name, array $rows, string $separator = "\t", string $null_as = "\\\\N"): bool {}
414
415    /**
416     * @param PgSql\Connection|string $connection
417     * @refcount 1
418     */
419    function pg_escape_string($connection, string $string = UNKNOWN): string {}
420
421    /**
422     * @param PgSql\Connection|string $connection
423     * @refcount 1
424     */
425    function pg_escape_bytea($connection, string $string = UNKNOWN): string {}
426
427    /** @refcount 1 */
428    function pg_unescape_bytea(string $string): string {}
429
430    /**
431     * @param PgSql\Connection|string $connection
432     * @refcount 1
433     */
434    function pg_escape_literal($connection, string $string = UNKNOWN): string|false {}
435
436    /**
437     * @param PgSql\Connection|string $connection
438     * @refcount 1
439     */
440    function pg_escape_identifier($connection, string $string = UNKNOWN): string|false {}
441
442    /** @refcount 1 */
443    function pg_result_error(PgSql\Result $result): string|false {}
444
445    /** @refcount 1 */
446    function pg_result_error_field(PgSql\Result $result, int $field_code): string|false|null {}
447
448    function pg_connection_status(PgSql\Connection $connection): int {}
449
450    function pg_transaction_status(PgSql\Connection $connection): int {}
451
452    function pg_connection_reset(PgSql\Connection $connection): bool {}
453
454    function pg_cancel_query(PgSql\Connection $connection): bool {}
455
456    function pg_connection_busy(PgSql\Connection $connection): bool {}
457
458    function pg_send_query(PgSql\Connection $connection, string $query): int|bool {}
459
460    function pg_send_query_params(PgSql\Connection $connection, string $query, array $params): int|bool {}
461
462    function pg_send_prepare(PgSql\Connection $connection, string $statement_name, string $query): int|bool {}
463
464    function pg_send_execute(PgSql\Connection $connection, string $statement_name, array $params): int|bool {}
465
466    /** @refcount 1 */
467    function pg_get_result(PgSql\Connection $connection): PgSql\Result|false {}
468
469    /** @refcount 1 */
470    function pg_result_status(PgSql\Result $result, int $mode = PGSQL_STATUS_LONG): string|int {}
471
472    /**
473     * @return array<int|string, int|string>
474     * @refcount 1
475     */
476    function pg_get_notify(PgSql\Connection $connection, int $mode = PGSQL_ASSOC): array|false {}
477
478    function pg_get_pid(PgSql\Connection $connection): int {}
479
480    /**
481     * @return resource|false
482     * @refcount 1
483     */
484    function pg_socket(PgSql\Connection $connection) {}
485
486    function pg_consume_input(PgSql\Connection $connection): bool {}
487
488    function pg_flush(PgSql\Connection $connection): int|bool {}
489
490    /**
491     * @return array<string, array>|false
492     * @refcount 1
493     */
494    function pg_meta_data(PgSql\Connection $connection, string $table_name, bool $extended = false): array|false {}
495
496    /**
497     * @return array<string, mixed>|false
498     * @refcount 1
499     */
500    function pg_convert(PgSql\Connection $connection, string $table_name, array $values, int $flags = 0): array|false {}
501
502    /** @refcount 1 */
503    function pg_insert(PgSql\Connection $connection, string $table_name, array $values, int $flags = PGSQL_DML_EXEC): PgSql\Result|string|bool {}
504
505    /** @refcount 1 */
506    function pg_update(PgSql\Connection $connection, string $table_name, array $values, array $conditions, int $flags = PGSQL_DML_EXEC): string|bool {}
507
508    /** @refcount 1 */
509    function pg_delete(PgSql\Connection $connection, string $table_name, array $conditions, int $flags = PGSQL_DML_EXEC): string|bool {}
510
511    /**
512     * @return array<int, array>|string|false
513     * @refcount 1
514     */
515    function pg_select(PgSql\Connection $connection, string $table_name, array $conditions, int $flags = PGSQL_DML_EXEC, int $mode = PGSQL_ASSOC): array|string|false {}
516
517}
518