xref: /php-src/ext/sqlite3/sqlite3.stub.php (revision f093015a)
1<?php
2
3/** @generate-class-entries */
4
5/**
6 * @var int
7 * @cvalue PHP_SQLITE3_ASSOC
8 */
9const SQLITE3_ASSOC = UNKNOWN;
10/**
11 * @var int
12 * @cvalue PHP_SQLITE3_NUM
13 */
14const SQLITE3_NUM = UNKNOWN;
15/**
16 * @var int
17 * @cvalue PHP_SQLITE3_BOTH
18 */
19const SQLITE3_BOTH = UNKNOWN;
20
21/**
22 * @var int
23 * @cvalue SQLITE_INTEGER
24 */
25const SQLITE3_INTEGER = UNKNOWN;
26/**
27 * @var int
28 * @cvalue SQLITE_FLOAT
29 */
30const SQLITE3_FLOAT = UNKNOWN;
31/**
32 * @var int
33 * @cvalue SQLITE3_TEXT
34 */
35const SQLITE3_TEXT = UNKNOWN;
36/**
37 * @var int
38 * @cvalue SQLITE_BLOB
39 */
40const SQLITE3_BLOB = UNKNOWN;
41/**
42 * @var int
43 * @cvalue SQLITE_NULL
44 */
45const SQLITE3_NULL = UNKNOWN;
46
47/**
48 * @var int
49 * @cvalue SQLITE_OPEN_READONLY
50 */
51const SQLITE3_OPEN_READONLY = UNKNOWN;
52/**
53 * @var int
54 * @cvalue SQLITE_OPEN_READWRITE
55 */
56const SQLITE3_OPEN_READWRITE = UNKNOWN;
57/**
58 * @var int
59 * @cvalue SQLITE_OPEN_CREATE
60 */
61const SQLITE3_OPEN_CREATE = UNKNOWN;
62
63#ifdef SQLITE_DETERMINISTIC
64/**
65 * @var int
66 * @cvalue SQLITE_DETERMINISTIC
67 */
68const SQLITE3_DETERMINISTIC = UNKNOWN;
69#endif
70
71/**
72 * @strict-properties
73 */
74class SQLite3Exception extends \Exception
75{
76}
77
78/** @not-serializable */
79class SQLite3
80{
81    /** @cvalue SQLITE_OK */
82    public const int OK = UNKNOWN;
83
84    /* Constants for authorizer return */
85
86    /** @cvalue SQLITE_DENY */
87    public const int DENY = UNKNOWN;
88    /** @cvalue SQLITE_IGNORE */
89    public const int IGNORE = UNKNOWN;
90
91    /* Constants for authorizer actions */
92
93    /** @cvalue SQLITE_CREATE_INDEX */
94    public const int CREATE_INDEX = UNKNOWN;
95    /** @cvalue SQLITE_CREATE_TABLE */
96    public const int CREATE_TABLE = UNKNOWN;
97    /** @cvalue SQLITE_CREATE_TEMP_INDEX */
98    public const int CREATE_TEMP_INDEX = UNKNOWN;
99    /** @cvalue SQLITE_CREATE_TEMP_TABLE */
100    public const int CREATE_TEMP_TABLE = UNKNOWN;
101    /** @cvalue SQLITE_CREATE_TEMP_TRIGGER */
102    public const int CREATE_TEMP_TRIGGER = UNKNOWN;
103    /** @cvalue SQLITE_CREATE_TEMP_VIEW */
104    public const int CREATE_TEMP_VIEW = UNKNOWN;
105    /** @cvalue SQLITE_CREATE_TRIGGER */
106    public const int CREATE_TRIGGER = UNKNOWN;
107    /** @cvalue SQLITE_CREATE_VIEW */
108    public const int CREATE_VIEW = UNKNOWN;
109    /** @cvalue SQLITE_DELETE */
110    public const int DELETE = UNKNOWN;
111    /** @cvalue SQLITE_DROP_INDEX */
112    public const int DROP_INDEX = UNKNOWN;
113    /** @cvalue SQLITE_DROP_TABLE */
114    public const int DROP_TABLE = UNKNOWN;
115    /** @cvalue SQLITE_DROP_TEMP_INDEX */
116    public const int DROP_TEMP_INDEX = UNKNOWN;
117    /** @cvalue SQLITE_DROP_TEMP_TABLE */
118    public const int DROP_TEMP_TABLE = UNKNOWN;
119    /** @cvalue SQLITE_DROP_TEMP_TRIGGER */
120    public const int DROP_TEMP_TRIGGER = UNKNOWN;
121    /** @cvalue SQLITE_DROP_TEMP_VIEW */
122    public const int DROP_TEMP_VIEW = UNKNOWN;
123    /** @cvalue SQLITE_DROP_TRIGGER */
124    public const int DROP_TRIGGER = UNKNOWN;
125    /** @cvalue SQLITE_DROP_VIEW */
126    public const int DROP_VIEW = UNKNOWN;
127    /** @cvalue SQLITE_INSERT */
128    public const int INSERT = UNKNOWN;
129    /** @cvalue SQLITE_PRAGMA */
130    public const int PRAGMA = UNKNOWN;
131    /** @cvalue SQLITE_READ */
132    public const int READ = UNKNOWN;
133    /** @cvalue SQLITE_SELECT */
134    public const int SELECT = UNKNOWN;
135    /** @cvalue SQLITE_TRANSACTION */
136    public const int TRANSACTION = UNKNOWN;
137    /** @cvalue SQLITE_UPDATE */
138    public const int UPDATE = UNKNOWN;
139    /** @cvalue SQLITE_ATTACH */
140    public const int ATTACH = UNKNOWN;
141    /** @cvalue SQLITE_DETACH */
142    public const int DETACH = UNKNOWN;
143    /** @cvalue SQLITE_ALTER_TABLE */
144    public const int ALTER_TABLE = UNKNOWN;
145    /** @cvalue SQLITE_REINDEX */
146    public const int REINDEX = UNKNOWN;
147    /** @cvalue SQLITE_ANALYZE */
148    public const int ANALYZE = UNKNOWN;
149    /** @cvalue SQLITE_CREATE_VTABLE */
150    public const int CREATE_VTABLE = UNKNOWN;
151    /** @cvalue SQLITE_DROP_VTABLE */
152    public const int DROP_VTABLE = UNKNOWN;
153    /** @cvalue SQLITE_FUNCTION */
154    public const int FUNCTION = UNKNOWN;
155    /** @cvalue SQLITE_SAVEPOINT */
156    public const int SAVEPOINT = UNKNOWN;
157    /** @cvalue SQLITE_COPY */
158    public const int COPY = UNKNOWN;
159#ifdef SQLITE_RECURSIVE
160    /** @cvalue SQLITE_RECURSIVE */
161    public const int RECURSIVE = UNKNOWN;
162#endif
163
164    /** @implementation-alias SQLite3::open */
165    public function __construct(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = "") {}
166
167    /**
168     * @tentative-return-type
169     * @todo SQLite3::open should really be static
170     */
171    public function open(string $filename, int $flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, string $encryptionKey = ""): void {}
172
173    /** @tentative-return-type */
174    public function close(): bool {}
175
176    /** @tentative-return-type */
177    public static function version(): array {}
178
179    /** @tentative-return-type */
180    public function lastInsertRowID(): int {}
181
182    /** @tentative-return-type */
183    public function lastErrorCode(): int {}
184
185    /** @tentative-return-type */
186    public function lastExtendedErrorCode(): int {}
187
188    /** @tentative-return-type */
189    public function lastErrorMsg(): string {}
190
191    /** @tentative-return-type */
192    public function changes(): int {}
193
194    /** @tentative-return-type */
195    public function busyTimeout(int $milliseconds): bool {}
196
197#ifndef SQLITE_OMIT_LOAD_EXTENSION
198    /** @tentative-return-type */
199    public function loadExtension(string $name): bool {}
200#endif
201
202#if SQLITE_VERSION_NUMBER >= 3006011
203    /** @tentative-return-type */
204    public function backup(SQLite3 $destination, string $sourceDatabase = "main", string $destinationDatabase = "main"): bool {}
205#endif
206
207    /** @tentative-return-type */
208    public static function escapeString(string $string): string {}
209
210    /** @tentative-return-type */
211    public function prepare(string $query): SQLite3Stmt|false {}
212
213    /** @tentative-return-type */
214    public function exec(string $query): bool {}
215
216    /** @tentative-return-type */
217    public function query(string $query): SQLite3Result|false {}
218
219    /** @tentative-return-type */
220    public function querySingle(string $query, bool $entireRow = false): mixed {}
221
222    /** @tentative-return-type */
223    public function createFunction(string $name, callable $callback, int $argCount = -1, int $flags = 0): bool {}
224
225    /** @tentative-return-type */
226    public function createAggregate(string $name, callable $stepCallback, callable $finalCallback, int $argCount = -1): bool {}
227
228    /** @tentative-return-type */
229    public function createCollation(string $name, callable $callback): bool {}
230
231    /** @return resource|false */
232    public function openBlob(string $table, string $column, int $rowid, string $database = "main", int $flags = SQLITE3_OPEN_READONLY) {}
233
234    /** @tentative-return-type */
235    public function enableExceptions(bool $enable = false): bool {}
236
237    /** @tentative-return-type */
238    public function enableExtendedResultCodes(bool $enable = true): bool {}
239
240    /** @tentative-return-type */
241    public function setAuthorizer(?callable $callback): bool {}
242}
243
244/** @not-serializable */
245class SQLite3Stmt
246{
247    private function __construct(SQLite3 $sqlite3, string $query) {}
248
249    /** @tentative-return-type */
250    public function bindParam(string|int $param, mixed &$var, int $type = SQLITE3_TEXT): bool {}
251
252    /** @tentative-return-type */
253    public function bindValue(string|int $param, mixed $value, int $type = SQLITE3_TEXT): bool {}
254
255    /** @tentative-return-type */
256    public function clear(): bool {}
257
258    /** @tentative-return-type */
259    public function close(): true {}
260
261    /** @tentative-return-type */
262    public function execute(): SQLite3Result|false {}
263
264    /** @tentative-return-type */
265    public function getSQL(bool $expand = false): string|false {}
266
267    /** @tentative-return-type */
268    public function paramCount(): int {}
269
270    /** @tentative-return-type */
271    public function readOnly(): bool {}
272
273    /** @tentative-return-type */
274    public function reset(): bool {}
275}
276
277/** @not-serializable */
278class SQLite3Result
279{
280    private function __construct() {}
281
282    /** @tentative-return-type */
283    public function numColumns(): int {}
284
285    /** @tentative-return-type */
286    public function columnName(int $column): string|false {}
287
288    /** @tentative-return-type */
289    public function columnType(int $column): int|false {}
290
291    /** @tentative-return-type */
292    public function fetchArray(int $mode = SQLITE3_BOTH): array|false {}
293
294    /** @tentative-return-type */
295    public function reset(): bool {}
296
297    /** @tentative-return-type */
298    public function finalize(): true {}
299}
300