pgsql.stub.php 15 KB

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