xref: /PHP-8.0/ext/sqlite3/sqlite3.stub.php (revision abe23bd9)
1<?php
2
3/** @generate-function-entries */
4
5class SQLite3
6{
7    /** @implementation-alias SQLite3::open */
8    public function __construct(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = "") {}
9
10    /** @return void */
11    public function open(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = "") {}
12
13    /** @return bool */
14    public function close() {}
15
16    /** @return array */
17    public static function version() {}
18
19    /** @return int */
20    public function lastInsertRowID() {}
21
22    /** @return int */
23    public function lastErrorCode() {}
24
25    /** @return int */
26    public function lastExtendedErrorCode() {}
27
28    /** @return string */
29    public function lastErrorMsg() {}
30
31    /** @return int */
32    public function changes() {}
33
34    /** @return bool */
35    public function busyTimeout(int $milliseconds) {}
36
37#ifndef SQLITE_OMIT_LOAD_EXTENSION
38    /** @return bool */
39    public function loadExtension(string $name) {}
40#endif
41
42#if SQLITE_VERSION_NUMBER >= 3006011
43    /** @return bool */
44    public function backup(SQLite3 $destination, string $sourceDatabase = "main", string $destinationDatabase = "main") {}
45#endif
46
47    /** @return string */
48    public static function escapeString(string $string) {}
49
50    /** @return SQLite3Stmt|false */
51    public function prepare(string $query) {}
52
53    /** @return bool */
54    public function exec(string $query) {}
55
56    /** @return SQLite3Result|false */
57    public function query(string $query) {}
58
59    /** @return mixed */
60    public function querySingle(string $query, bool $entireRow = false) {}
61
62    /** @return bool */
63    public function createFunction(string $name, callable $callback, int $argCount = -1, int $flags = 0) {}
64
65    /** @return bool */
66    public function createAggregate(string $name, callable $stepCallback, callable $finalCallback, int $argCount = -1) {}
67
68    /** @return bool */
69    public function createCollation(string $name, callable $callback) {}
70
71    /** @return resource|false */
72    public function openBlob(string $table, string $column, int $rowid, string $database = "main", int $flags = SQLITE3_OPEN_READONLY) {}
73
74    /** @return bool */
75    public function enableExceptions(bool $enable = false) {}
76
77    /** @return bool */
78    public function enableExtendedResultCodes(bool $enable = true) {}
79
80    /** @return bool */
81    public function setAuthorizer(?callable $callback) {}
82}
83
84class SQLite3Stmt
85{
86    private function __construct(SQLite3 $sqlite3, string $query) {}
87
88    /** @return bool */
89    public function bindParam(string|int $param, mixed &$var, int $type = SQLITE3_TEXT) {}
90
91    /** @return bool */
92    public function bindValue(string|int $param, mixed $value, int $type = SQLITE3_TEXT) {}
93
94    /** @return bool */
95    public function clear() {}
96
97    /** @return bool */
98    public function close() {}
99
100    /** @return SQLite3Result|false */
101    public function execute() {}
102
103    /** @return string|false */
104    public function getSQL(bool $expand = false) {}
105
106    /** @return int */
107    public function paramCount() {}
108
109    /** @return bool */
110    public function readOnly() {}
111
112    /** @return bool */
113    public function reset() {}
114}
115
116class SQLite3Result
117{
118    private function __construct() {}
119
120    /** @return int */
121    public function numColumns() {}
122
123    /** @return string|false */
124    public function columnName(int $column) {}
125
126    /** @return int|false */
127    public function columnType(int $column) {}
128
129    /** @return array|false */
130    public function fetchArray(int $mode = SQLITE3_BOTH) {}
131
132    /** @return bool */
133    public function reset() {}
134
135    /** @return bool */
136    public function finalize() {}
137}
138