1 module sqlite3;
2 
3 import core.stdc.config;
4 import core.stdc.stdarg;
5 
6 nothrow extern (C):
7 
8 enum SQLITE_VERSION = "3.46.0";
9 enum SQLITE_VERSION_NUMBER = 3046000;
10 enum SQLITE_SOURCE_ID = "2024-05-23 13:25:27 96c92aba00c8375bc32fafcdf12429c58bd8aabfcadab6683e35bbb9cdebf19e";
11 
12 extern __gshared const(char)[] sqlite3_version;
13 const(char)* sqlite3_libversion ();
14 const(char)* sqlite3_sourceid ();
15 int sqlite3_libversion_number ();
16 
17 int sqlite3_compileoption_used (const(char)* zOptName);
18 const(char)* sqlite3_compileoption_get (int N);
19 
20 int sqlite3_threadsafe ();
21 
22 struct sqlite3;
23 
24 alias sqlite_int64 = long;
25 alias sqlite_uint64 = ulong;
26 
27 alias sqlite3_int64 = long;
28 alias sqlite3_uint64 = ulong;
29 
30 int sqlite3_close (sqlite3*);
31 int sqlite3_close_v2 (sqlite3*);
32 
33 alias sqlite3_callback = int function (void*, int, char**, char**);
34 
35 int sqlite3_exec (
36     sqlite3*,
37     const(char)* sql,
38     int function (void*, int, char**, char**) callback,
39     void*,
40     char** errmsg);
41 
42 enum SQLITE_OK = 0;
43 
44 enum SQLITE_ERROR = 1;
45 enum SQLITE_INTERNAL = 2;
46 enum SQLITE_PERM = 3;
47 enum SQLITE_ABORT = 4;
48 enum SQLITE_BUSY = 5;
49 enum SQLITE_LOCKED = 6;
50 enum SQLITE_NOMEM = 7;
51 enum SQLITE_READONLY = 8;
52 enum SQLITE_INTERRUPT = 9;
53 enum SQLITE_IOERR = 10;
54 enum SQLITE_CORRUPT = 11;
55 enum SQLITE_NOTFOUND = 12;
56 enum SQLITE_FULL = 13;
57 enum SQLITE_CANTOPEN = 14;
58 enum SQLITE_PROTOCOL = 15;
59 enum SQLITE_EMPTY = 16;
60 enum SQLITE_SCHEMA = 17;
61 enum SQLITE_TOOBIG = 18;
62 enum SQLITE_CONSTRAINT = 19;
63 enum SQLITE_MISMATCH = 20;
64 enum SQLITE_MISUSE = 21;
65 enum SQLITE_NOLFS = 22;
66 enum SQLITE_AUTH = 23;
67 enum SQLITE_FORMAT = 24;
68 enum SQLITE_RANGE = 25;
69 enum SQLITE_NOTADB = 26;
70 enum SQLITE_NOTICE = 27;
71 enum SQLITE_WARNING = 28;
72 enum SQLITE_ROW = 100;
73 enum SQLITE_DONE = 101;
74 
75 enum SQLITE_ERROR_MISSING_COLLSEQ = SQLITE_ERROR | (1 << 8);
76 enum SQLITE_ERROR_RETRY = SQLITE_ERROR | (2 << 8);
77 enum SQLITE_ERROR_SNAPSHOT = SQLITE_ERROR | (3 << 8);
78 enum SQLITE_IOERR_READ = SQLITE_IOERR | (1 << 8);
79 enum SQLITE_IOERR_SHORT_READ = SQLITE_IOERR | (2 << 8);
80 enum SQLITE_IOERR_WRITE = SQLITE_IOERR | (3 << 8);
81 enum SQLITE_IOERR_FSYNC = SQLITE_IOERR | (4 << 8);
82 enum SQLITE_IOERR_DIR_FSYNC = SQLITE_IOERR | (5 << 8);
83 enum SQLITE_IOERR_TRUNCATE = SQLITE_IOERR | (6 << 8);
84 enum SQLITE_IOERR_FSTAT = SQLITE_IOERR | (7 << 8);
85 enum SQLITE_IOERR_UNLOCK = SQLITE_IOERR | (8 << 8);
86 enum SQLITE_IOERR_RDLOCK = SQLITE_IOERR | (9 << 8);
87 enum SQLITE_IOERR_DELETE = SQLITE_IOERR | (10 << 8);
88 enum SQLITE_IOERR_BLOCKED = SQLITE_IOERR | (11 << 8);
89 enum SQLITE_IOERR_NOMEM = SQLITE_IOERR | (12 << 8);
90 enum SQLITE_IOERR_ACCESS = SQLITE_IOERR | (13 << 8);
91 enum SQLITE_IOERR_CHECKRESERVEDLOCK = SQLITE_IOERR | (14 << 8);
92 enum SQLITE_IOERR_LOCK = SQLITE_IOERR | (15 << 8);
93 enum SQLITE_IOERR_CLOSE = SQLITE_IOERR | (16 << 8);
94 enum SQLITE_IOERR_DIR_CLOSE = SQLITE_IOERR | (17 << 8);
95 enum SQLITE_IOERR_SHMOPEN = SQLITE_IOERR | (18 << 8);
96 enum SQLITE_IOERR_SHMSIZE = SQLITE_IOERR | (19 << 8);
97 enum SQLITE_IOERR_SHMLOCK = SQLITE_IOERR | (20 << 8);
98 enum SQLITE_IOERR_SHMMAP = SQLITE_IOERR | (21 << 8);
99 enum SQLITE_IOERR_SEEK = SQLITE_IOERR | (22 << 8);
100 enum SQLITE_IOERR_DELETE_NOENT = SQLITE_IOERR | (23 << 8);
101 enum SQLITE_IOERR_MMAP = SQLITE_IOERR | (24 << 8);
102 enum SQLITE_IOERR_GETTEMPPATH = SQLITE_IOERR | (25 << 8);
103 enum SQLITE_IOERR_CONVPATH = SQLITE_IOERR | (26 << 8);
104 enum SQLITE_IOERR_VNODE = SQLITE_IOERR | (27 << 8);
105 enum SQLITE_IOERR_AUTH = SQLITE_IOERR | (28 << 8);
106 enum SQLITE_IOERR_BEGIN_ATOMIC = SQLITE_IOERR | (29 << 8);
107 enum SQLITE_IOERR_COMMIT_ATOMIC = SQLITE_IOERR | (30 << 8);
108 enum SQLITE_IOERR_ROLLBACK_ATOMIC = SQLITE_IOERR | (31 << 8);
109 enum SQLITE_IOERR_DATA = SQLITE_IOERR | (32 << 8);
110 enum SQLITE_IOERR_CORRUPTFS = SQLITE_IOERR | (33 << 8);
111 enum SQLITE_IOERR_IN_PAGE = SQLITE_IOERR | (34 << 8);
112 enum SQLITE_LOCKED_SHAREDCACHE = SQLITE_LOCKED | (1 << 8);
113 enum SQLITE_LOCKED_VTAB = SQLITE_LOCKED | (2 << 8);
114 enum SQLITE_BUSY_RECOVERY = SQLITE_BUSY | (1 << 8);
115 enum SQLITE_BUSY_SNAPSHOT = SQLITE_BUSY | (2 << 8);
116 enum SQLITE_BUSY_TIMEOUT = SQLITE_BUSY | (3 << 8);
117 enum SQLITE_CANTOPEN_NOTEMPDIR = SQLITE_CANTOPEN | (1 << 8);
118 enum SQLITE_CANTOPEN_ISDIR = SQLITE_CANTOPEN | (2 << 8);
119 enum SQLITE_CANTOPEN_FULLPATH = SQLITE_CANTOPEN | (3 << 8);
120 enum SQLITE_CANTOPEN_CONVPATH = SQLITE_CANTOPEN | (4 << 8);
121 enum SQLITE_CANTOPEN_DIRTYWAL = SQLITE_CANTOPEN | (5 << 8);
122 enum SQLITE_CANTOPEN_SYMLINK = SQLITE_CANTOPEN | (6 << 8);
123 enum SQLITE_CORRUPT_VTAB = SQLITE_CORRUPT | (1 << 8);
124 enum SQLITE_CORRUPT_SEQUENCE = SQLITE_CORRUPT | (2 << 8);
125 enum SQLITE_CORRUPT_INDEX = SQLITE_CORRUPT | (3 << 8);
126 enum SQLITE_READONLY_RECOVERY = SQLITE_READONLY | (1 << 8);
127 enum SQLITE_READONLY_CANTLOCK = SQLITE_READONLY | (2 << 8);
128 enum SQLITE_READONLY_ROLLBACK = SQLITE_READONLY | (3 << 8);
129 enum SQLITE_READONLY_DBMOVED = SQLITE_READONLY | (4 << 8);
130 enum SQLITE_READONLY_CANTINIT = SQLITE_READONLY | (5 << 8);
131 enum SQLITE_READONLY_DIRECTORY = SQLITE_READONLY | (6 << 8);
132 enum SQLITE_ABORT_ROLLBACK = SQLITE_ABORT | (2 << 8);
133 enum SQLITE_CONSTRAINT_CHECK = SQLITE_CONSTRAINT | (1 << 8);
134 enum SQLITE_CONSTRAINT_COMMITHOOK = SQLITE_CONSTRAINT | (2 << 8);
135 enum SQLITE_CONSTRAINT_FOREIGNKEY = SQLITE_CONSTRAINT | (3 << 8);
136 enum SQLITE_CONSTRAINT_FUNCTION = SQLITE_CONSTRAINT | (4 << 8);
137 enum SQLITE_CONSTRAINT_NOTNULL = SQLITE_CONSTRAINT | (5 << 8);
138 enum SQLITE_CONSTRAINT_PRIMARYKEY = SQLITE_CONSTRAINT | (6 << 8);
139 enum SQLITE_CONSTRAINT_TRIGGER = SQLITE_CONSTRAINT | (7 << 8);
140 enum SQLITE_CONSTRAINT_UNIQUE = SQLITE_CONSTRAINT | (8 << 8);
141 enum SQLITE_CONSTRAINT_VTAB = SQLITE_CONSTRAINT | (9 << 8);
142 enum SQLITE_CONSTRAINT_ROWID = SQLITE_CONSTRAINT | (10 << 8);
143 enum SQLITE_CONSTRAINT_PINNED = SQLITE_CONSTRAINT | (11 << 8);
144 enum SQLITE_CONSTRAINT_DATATYPE = SQLITE_CONSTRAINT | (12 << 8);
145 enum SQLITE_NOTICE_RECOVER_WAL = SQLITE_NOTICE | (1 << 8);
146 enum SQLITE_NOTICE_RECOVER_ROLLBACK = SQLITE_NOTICE | (2 << 8);
147 enum SQLITE_NOTICE_RBU = SQLITE_NOTICE | (3 << 8);
148 enum SQLITE_WARNING_AUTOINDEX = SQLITE_WARNING | (1 << 8);
149 enum SQLITE_AUTH_USER = SQLITE_AUTH | (1 << 8);
150 enum SQLITE_OK_LOAD_PERMANENTLY = SQLITE_OK | (1 << 8);
151 enum SQLITE_OK_SYMLINK = SQLITE_OK | (2 << 8);
152 
153 enum SQLITE_OPEN_READONLY = 0x00000001;
154 enum SQLITE_OPEN_READWRITE = 0x00000002;
155 enum SQLITE_OPEN_CREATE = 0x00000004;
156 enum SQLITE_OPEN_DELETEONCLOSE = 0x00000008;
157 enum SQLITE_OPEN_EXCLUSIVE = 0x00000010;
158 enum SQLITE_OPEN_AUTOPROXY = 0x00000020;
159 enum SQLITE_OPEN_URI = 0x00000040;
160 enum SQLITE_OPEN_MEMORY = 0x00000080;
161 enum SQLITE_OPEN_MAIN_DB = 0x00000100;
162 enum SQLITE_OPEN_TEMP_DB = 0x00000200;
163 enum SQLITE_OPEN_TRANSIENT_DB = 0x00000400;
164 enum SQLITE_OPEN_MAIN_JOURNAL = 0x00000800;
165 enum SQLITE_OPEN_TEMP_JOURNAL = 0x00001000;
166 enum SQLITE_OPEN_SUBJOURNAL = 0x00002000;
167 enum SQLITE_OPEN_SUPER_JOURNAL = 0x00004000;
168 enum SQLITE_OPEN_NOMUTEX = 0x00008000;
169 enum SQLITE_OPEN_FULLMUTEX = 0x00010000;
170 enum SQLITE_OPEN_SHAREDCACHE = 0x00020000;
171 enum SQLITE_OPEN_PRIVATECACHE = 0x00040000;
172 enum SQLITE_OPEN_WAL = 0x00080000;
173 enum SQLITE_OPEN_NOFOLLOW = 0x01000000;
174 enum SQLITE_OPEN_EXRESCODE = 0x02000000;
175 
176 enum SQLITE_OPEN_MASTER_JOURNAL = 0x00004000;
177 
178 enum SQLITE_IOCAP_ATOMIC = 0x00000001;
179 enum SQLITE_IOCAP_ATOMIC512 = 0x00000002;
180 enum SQLITE_IOCAP_ATOMIC1K = 0x00000004;
181 enum SQLITE_IOCAP_ATOMIC2K = 0x00000008;
182 enum SQLITE_IOCAP_ATOMIC4K = 0x00000010;
183 enum SQLITE_IOCAP_ATOMIC8K = 0x00000020;
184 enum SQLITE_IOCAP_ATOMIC16K = 0x00000040;
185 enum SQLITE_IOCAP_ATOMIC32K = 0x00000080;
186 enum SQLITE_IOCAP_ATOMIC64K = 0x00000100;
187 enum SQLITE_IOCAP_SAFE_APPEND = 0x00000200;
188 enum SQLITE_IOCAP_SEQUENTIAL = 0x00000400;
189 enum SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN = 0x00000800;
190 enum SQLITE_IOCAP_POWERSAFE_OVERWRITE = 0x00001000;
191 enum SQLITE_IOCAP_IMMUTABLE = 0x00002000;
192 enum SQLITE_IOCAP_BATCH_ATOMIC = 0x00004000;
193 
194 enum SQLITE_LOCK_NONE = 0;
195 enum SQLITE_LOCK_SHARED = 1;
196 enum SQLITE_LOCK_RESERVED = 2;
197 enum SQLITE_LOCK_PENDING = 3;
198 enum SQLITE_LOCK_EXCLUSIVE = 4;
199 
200 enum SQLITE_SYNC_NORMAL = 0x00002;
201 enum SQLITE_SYNC_FULL = 0x00003;
202 enum SQLITE_SYNC_DATAONLY = 0x00010;
203 
204 struct sqlite3_file
205 {
206     const(sqlite3_io_methods)* pMethods;
207 }
208 
209 struct sqlite3_io_methods
210 {
211     int iVersion;
212     int function (sqlite3_file*) xClose;
213     int function (sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst) xRead;
214     int function (sqlite3_file*, const(void)*, int iAmt, sqlite3_int64 iOfst) xWrite;
215     int function (sqlite3_file*, sqlite3_int64 size) xTruncate;
216     int function (sqlite3_file*, int flags) xSync;
217     int function (sqlite3_file*, sqlite3_int64* pSize) xFileSize;
218     int function (sqlite3_file*, int) xLock;
219     int function (sqlite3_file*, int) xUnlock;
220     int function (sqlite3_file*, int* pResOut) xCheckReservedLock;
221     int function (sqlite3_file*, int op, void* pArg) xFileControl;
222     int function (sqlite3_file*) xSectorSize;
223     int function (sqlite3_file*) xDeviceCharacteristics;
224 
225     int function (sqlite3_file*, int iPg, int pgsz, int, void**) xShmMap;
226     int function (sqlite3_file*, int offset, int n, int flags) xShmLock;
227     void function (sqlite3_file*) xShmBarrier;
228     int function (sqlite3_file*, int deleteFlag) xShmUnmap;
229 
230     int function (sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void** pp) xFetch;
231     int function (sqlite3_file*, sqlite3_int64 iOfst, void* p) xUnfetch;
232 }
233 
234 enum SQLITE_FCNTL_LOCKSTATE = 1;
235 enum SQLITE_FCNTL_GET_LOCKPROXYFILE = 2;
236 enum SQLITE_FCNTL_SET_LOCKPROXYFILE = 3;
237 enum SQLITE_FCNTL_LAST_ERRNO = 4;
238 enum SQLITE_FCNTL_SIZE_HINT = 5;
239 enum SQLITE_FCNTL_CHUNK_SIZE = 6;
240 enum SQLITE_FCNTL_FILE_POINTER = 7;
241 enum SQLITE_FCNTL_SYNC_OMITTED = 8;
242 enum SQLITE_FCNTL_WIN32_AV_RETRY = 9;
243 enum SQLITE_FCNTL_PERSIST_WAL = 10;
244 enum SQLITE_FCNTL_OVERWRITE = 11;
245 enum SQLITE_FCNTL_VFSNAME = 12;
246 enum SQLITE_FCNTL_POWERSAFE_OVERWRITE = 13;
247 enum SQLITE_FCNTL_PRAGMA = 14;
248 enum SQLITE_FCNTL_BUSYHANDLER = 15;
249 enum SQLITE_FCNTL_TEMPFILENAME = 16;
250 enum SQLITE_FCNTL_MMAP_SIZE = 18;
251 enum SQLITE_FCNTL_TRACE = 19;
252 enum SQLITE_FCNTL_HAS_MOVED = 20;
253 enum SQLITE_FCNTL_SYNC = 21;
254 enum SQLITE_FCNTL_COMMIT_PHASETWO = 22;
255 enum SQLITE_FCNTL_WIN32_SET_HANDLE = 23;
256 enum SQLITE_FCNTL_WAL_BLOCK = 24;
257 enum SQLITE_FCNTL_ZIPVFS = 25;
258 enum SQLITE_FCNTL_RBU = 26;
259 enum SQLITE_FCNTL_VFS_POINTER = 27;
260 enum SQLITE_FCNTL_JOURNAL_POINTER = 28;
261 enum SQLITE_FCNTL_WIN32_GET_HANDLE = 29;
262 enum SQLITE_FCNTL_PDB = 30;
263 enum SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31;
264 enum SQLITE_FCNTL_COMMIT_ATOMIC_WRITE = 32;
265 enum SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE = 33;
266 enum SQLITE_FCNTL_LOCK_TIMEOUT = 34;
267 enum SQLITE_FCNTL_DATA_VERSION = 35;
268 enum SQLITE_FCNTL_SIZE_LIMIT = 36;
269 enum SQLITE_FCNTL_CKPT_DONE = 37;
270 enum SQLITE_FCNTL_RESERVE_BYTES = 38;
271 enum SQLITE_FCNTL_CKPT_START = 39;
272 enum SQLITE_FCNTL_EXTERNAL_READER = 40;
273 enum SQLITE_FCNTL_CKSM_FILE = 41;
274 enum SQLITE_FCNTL_RESET_CACHE = 42;
275 
276 enum SQLITE_GET_LOCKPROXYFILE = SQLITE_FCNTL_GET_LOCKPROXYFILE;
277 enum SQLITE_SET_LOCKPROXYFILE = SQLITE_FCNTL_SET_LOCKPROXYFILE;
278 enum SQLITE_LAST_ERRNO = SQLITE_FCNTL_LAST_ERRNO;
279 
280 struct sqlite3_mutex;
281 
282 struct sqlite3_api_routines;
283 
284 alias sqlite3_filename = const(char)*;
285 
286 alias sqlite3_syscall_ptr = void function ();
287 
288 struct sqlite3_vfs
289 {
290     int iVersion;
291     int szOsFile;
292     int mxPathname;
293     sqlite3_vfs* pNext;
294     const(char)* zName;
295     void* pAppData;
296     int function (
297         sqlite3_vfs*,
298         sqlite3_filename zName,
299         sqlite3_file*,
300         int flags,
301         int* pOutFlags) xOpen;
302     int function (sqlite3_vfs*, const(char)* zName, int syncDir) xDelete;
303     int function (sqlite3_vfs*, const(char)* zName, int flags, int* pResOut) xAccess;
304     int function (sqlite3_vfs*, const(char)* zName, int nOut, char* zOut) xFullPathname;
305     void* function (sqlite3_vfs*, const(char)* zFilename) xDlOpen;
306     void function (sqlite3_vfs*, int nByte, char* zErrMsg) xDlError;
307     void function (sqlite3_vfs*, void*, const(char)* zSymbol) function (sqlite3_vfs*, void*, const(char)* zSymbol) xDlSym;
308     void function (sqlite3_vfs*, void*) xDlClose;
309     int function (sqlite3_vfs*, int nByte, char* zOut) xRandomness;
310     int function (sqlite3_vfs*, int microseconds) xSleep;
311     int function (sqlite3_vfs*, double*) xCurrentTime;
312     int function (sqlite3_vfs*, int, char*) xGetLastError;
313 
314     int function (sqlite3_vfs*, sqlite3_int64*) xCurrentTimeInt64;
315 
316     int function (sqlite3_vfs*, const(char)* zName, sqlite3_syscall_ptr) xSetSystemCall;
317     sqlite3_syscall_ptr function (sqlite3_vfs*, const(char)* zName) xGetSystemCall;
318     const(char)* function (sqlite3_vfs*, const(char)* zName) xNextSystemCall;
319 }
320 
321 enum SQLITE_ACCESS_EXISTS = 0;
322 enum SQLITE_ACCESS_READWRITE = 1;
323 enum SQLITE_ACCESS_READ = 2;
324 
325 enum SQLITE_SHM_UNLOCK = 1;
326 enum SQLITE_SHM_LOCK = 2;
327 enum SQLITE_SHM_SHARED = 4;
328 enum SQLITE_SHM_EXCLUSIVE = 8;
329 
330 enum SQLITE_SHM_NLOCK = 8;
331 
332 int sqlite3_initialize ();
333 int sqlite3_shutdown ();
334 int sqlite3_os_init ();
335 int sqlite3_os_end ();
336 
337 int sqlite3_config (int, ...);
338 
339 int sqlite3_db_config (sqlite3*, int op, ...);
340 
341 struct sqlite3_mem_methods
342 {
343     void* function (int) xMalloc;
344     void function (void*) xFree;
345     void* function (void*, int) xRealloc;
346     int function (void*) xSize;
347     int function (int) xRoundup;
348     int function (void*) xInit;
349     void function (void*) xShutdown;
350     void* pAppData;
351 }
352 
353 enum SQLITE_CONFIG_SINGLETHREAD = 1;
354 enum SQLITE_CONFIG_MULTITHREAD = 2;
355 enum SQLITE_CONFIG_SERIALIZED = 3;
356 enum SQLITE_CONFIG_MALLOC = 4;
357 enum SQLITE_CONFIG_GETMALLOC = 5;
358 enum SQLITE_CONFIG_SCRATCH = 6;
359 enum SQLITE_CONFIG_PAGECACHE = 7;
360 enum SQLITE_CONFIG_HEAP = 8;
361 enum SQLITE_CONFIG_MEMSTATUS = 9;
362 enum SQLITE_CONFIG_MUTEX = 10;
363 enum SQLITE_CONFIG_GETMUTEX = 11;
364 
365 enum SQLITE_CONFIG_LOOKASIDE = 13;
366 enum SQLITE_CONFIG_PCACHE = 14;
367 enum SQLITE_CONFIG_GETPCACHE = 15;
368 enum SQLITE_CONFIG_LOG = 16;
369 enum SQLITE_CONFIG_URI = 17;
370 enum SQLITE_CONFIG_PCACHE2 = 18;
371 enum SQLITE_CONFIG_GETPCACHE2 = 19;
372 enum SQLITE_CONFIG_COVERING_INDEX_SCAN = 20;
373 enum SQLITE_CONFIG_SQLLOG = 21;
374 enum SQLITE_CONFIG_MMAP_SIZE = 22;
375 enum SQLITE_CONFIG_WIN32_HEAPSIZE = 23;
376 enum SQLITE_CONFIG_PCACHE_HDRSZ = 24;
377 enum SQLITE_CONFIG_PMASZ = 25;
378 enum SQLITE_CONFIG_STMTJRNL_SPILL = 26;
379 enum SQLITE_CONFIG_SMALL_MALLOC = 27;
380 enum SQLITE_CONFIG_SORTERREF_SIZE = 28;
381 enum SQLITE_CONFIG_MEMDB_MAXSIZE = 29;
382 enum SQLITE_CONFIG_ROWID_IN_VIEW = 30;
383 
384 enum SQLITE_DBCONFIG_MAINDBNAME = 1000;
385 enum SQLITE_DBCONFIG_LOOKASIDE = 1001;
386 enum SQLITE_DBCONFIG_ENABLE_FKEY = 1002;
387 enum SQLITE_DBCONFIG_ENABLE_TRIGGER = 1003;
388 enum SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER = 1004;
389 enum SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION = 1005;
390 enum SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE = 1006;
391 enum SQLITE_DBCONFIG_ENABLE_QPSG = 1007;
392 enum SQLITE_DBCONFIG_TRIGGER_EQP = 1008;
393 enum SQLITE_DBCONFIG_RESET_DATABASE = 1009;
394 enum SQLITE_DBCONFIG_DEFENSIVE = 1010;
395 enum SQLITE_DBCONFIG_WRITABLE_SCHEMA = 1011;
396 enum SQLITE_DBCONFIG_LEGACY_ALTER_TABLE = 1012;
397 enum SQLITE_DBCONFIG_DQS_DML = 1013;
398 enum SQLITE_DBCONFIG_DQS_DDL = 1014;
399 enum SQLITE_DBCONFIG_ENABLE_VIEW = 1015;
400 enum SQLITE_DBCONFIG_LEGACY_FILE_FORMAT = 1016;
401 enum SQLITE_DBCONFIG_TRUSTED_SCHEMA = 1017;
402 enum SQLITE_DBCONFIG_STMT_SCANSTATUS = 1018;
403 enum SQLITE_DBCONFIG_REVERSE_SCANORDER = 1019;
404 enum SQLITE_DBCONFIG_MAX = 1019;
405 
406 int sqlite3_extended_result_codes (sqlite3*, int onoff);
407 
408 sqlite3_int64 sqlite3_last_insert_rowid (sqlite3*);
409 
410 void sqlite3_set_last_insert_rowid (sqlite3*, sqlite3_int64);
411 
412 int sqlite3_changes (sqlite3*);
413 sqlite3_int64 sqlite3_changes64 (sqlite3*);
414 
415 int sqlite3_total_changes (sqlite3*);
416 sqlite3_int64 sqlite3_total_changes64 (sqlite3*);
417 
418 void sqlite3_interrupt (sqlite3*);
419 int sqlite3_is_interrupted (sqlite3*);
420 
421 int sqlite3_complete (const(char)* sql);
422 int sqlite3_complete16 (const(void)* sql);
423 
424 int sqlite3_busy_handler (sqlite3*, int function (void*, int), void*);
425 
426 int sqlite3_busy_timeout (sqlite3*, int ms);
427 
428 int sqlite3_get_table (
429     sqlite3* db,
430     const(char)* zSql,
431     char*** pazResult,
432     int* pnRow,
433     int* pnColumn,
434     char** pzErrmsg);
435 void sqlite3_free_table (char** result);
436 
437 char* sqlite3_mprintf (const(char)*, ...);
438 char* sqlite3_vmprintf (const(char)*, va_list);
439 char* sqlite3_snprintf (int, char*, const(char)*, ...);
440 char* sqlite3_vsnprintf (int, char*, const(char)*, va_list);
441 
442 void* sqlite3_malloc (int);
443 void* sqlite3_malloc64 (sqlite3_uint64);
444 void* sqlite3_realloc (void*, int);
445 void* sqlite3_realloc64 (void*, sqlite3_uint64);
446 void sqlite3_free (void*);
447 sqlite3_uint64 sqlite3_msize (void*);
448 
449 sqlite3_int64 sqlite3_memory_used ();
450 sqlite3_int64 sqlite3_memory_highwater (int resetFlag);
451 
452 void sqlite3_randomness (int N, void* P);
453 
454 int sqlite3_set_authorizer (
455     sqlite3*,
456     int function (void*, int, const(char)*, const(char)*, const(char)*, const(char)*) xAuth,
457     void* pUserData);
458 
459 enum SQLITE_DENY = 1;
460 enum SQLITE_IGNORE = 2;
461 
462 enum SQLITE_CREATE_INDEX = 1;
463 enum SQLITE_CREATE_TABLE = 2;
464 enum SQLITE_CREATE_TEMP_INDEX = 3;
465 enum SQLITE_CREATE_TEMP_TABLE = 4;
466 enum SQLITE_CREATE_TEMP_TRIGGER = 5;
467 enum SQLITE_CREATE_TEMP_VIEW = 6;
468 enum SQLITE_CREATE_TRIGGER = 7;
469 enum SQLITE_CREATE_VIEW = 8;
470 enum SQLITE_DELETE = 9;
471 enum SQLITE_DROP_INDEX = 10;
472 enum SQLITE_DROP_TABLE = 11;
473 enum SQLITE_DROP_TEMP_INDEX = 12;
474 enum SQLITE_DROP_TEMP_TABLE = 13;
475 enum SQLITE_DROP_TEMP_TRIGGER = 14;
476 enum SQLITE_DROP_TEMP_VIEW = 15;
477 enum SQLITE_DROP_TRIGGER = 16;
478 enum SQLITE_DROP_VIEW = 17;
479 enum SQLITE_INSERT = 18;
480 enum SQLITE_PRAGMA = 19;
481 enum SQLITE_READ = 20;
482 enum SQLITE_SELECT = 21;
483 enum SQLITE_TRANSACTION = 22;
484 enum SQLITE_UPDATE = 23;
485 enum SQLITE_ATTACH = 24;
486 enum SQLITE_DETACH = 25;
487 enum SQLITE_ALTER_TABLE = 26;
488 enum SQLITE_REINDEX = 27;
489 enum SQLITE_ANALYZE = 28;
490 enum SQLITE_CREATE_VTABLE = 29;
491 enum SQLITE_DROP_VTABLE = 30;
492 enum SQLITE_FUNCTION = 31;
493 enum SQLITE_SAVEPOINT = 32;
494 enum SQLITE_COPY = 0;
495 enum SQLITE_RECURSIVE = 33;
496 
497 void* sqlite3_trace (
498     sqlite3*,
499     void function (void*, const(char)*) xTrace,
500     void*);
501 void* sqlite3_profile (
502     sqlite3*,
503     void function (void*, const(char)*, sqlite3_uint64) xProfile,
504     void*);
505 
506 enum SQLITE_TRACE_STMT = 0x01;
507 enum SQLITE_TRACE_PROFILE = 0x02;
508 enum SQLITE_TRACE_ROW = 0x04;
509 enum SQLITE_TRACE_CLOSE = 0x08;
510 
511 int sqlite3_trace_v2 (
512     sqlite3*,
513     uint uMask,
514     int function (uint, void*, void*, void*) xCallback,
515     void* pCtx);
516 
517 void sqlite3_progress_handler (sqlite3*, int, int function (void*), void*);
518 
519 int sqlite3_open (const(char)* filename, sqlite3** ppDb);
520 int sqlite3_open16 (const(void)* filename, sqlite3** ppDb);
521 int sqlite3_open_v2 (
522     const(char)* filename,
523     sqlite3** ppDb,
524     int flags,
525     const(char)* zVfs);
526 
527 const(char)* sqlite3_uri_parameter (sqlite3_filename z, const(char)* zParam);
528 int sqlite3_uri_boolean (sqlite3_filename z, const(char)* zParam, int bDefault);
529 sqlite3_int64 sqlite3_uri_int64 (sqlite3_filename, const(char)*, sqlite3_int64);
530 const(char)* sqlite3_uri_key (sqlite3_filename z, int N);
531 
532 const(char)* sqlite3_filename_database (sqlite3_filename);
533 const(char)* sqlite3_filename_journal (sqlite3_filename);
534 const(char)* sqlite3_filename_wal (sqlite3_filename);
535 
536 sqlite3_file* sqlite3_database_file_object (const(char)*);
537 
538 sqlite3_filename sqlite3_create_filename (
539     const(char)* zDatabase,
540     const(char)* zJournal,
541     const(char)* zWal,
542     int nParam,
543     const(char*)* azParam);
544 void sqlite3_free_filename (sqlite3_filename);
545 
546 int sqlite3_errcode (sqlite3* db);
547 int sqlite3_extended_errcode (sqlite3* db);
548 const(char)* sqlite3_errmsg (sqlite3*);
549 const(void)* sqlite3_errmsg16 (sqlite3*);
550 const(char)* sqlite3_errstr (int);
551 int sqlite3_error_offset (sqlite3* db);
552 
553 struct sqlite3_stmt;
554 
555 int sqlite3_limit (sqlite3*, int id, int newVal);
556 
557 enum SQLITE_LIMIT_LENGTH = 0;
558 enum SQLITE_LIMIT_SQL_LENGTH = 1;
559 enum SQLITE_LIMIT_COLUMN = 2;
560 enum SQLITE_LIMIT_EXPR_DEPTH = 3;
561 enum SQLITE_LIMIT_COMPOUND_SELECT = 4;
562 enum SQLITE_LIMIT_VDBE_OP = 5;
563 enum SQLITE_LIMIT_FUNCTION_ARG = 6;
564 enum SQLITE_LIMIT_ATTACHED = 7;
565 enum SQLITE_LIMIT_LIKE_PATTERN_LENGTH = 8;
566 enum SQLITE_LIMIT_VARIABLE_NUMBER = 9;
567 enum SQLITE_LIMIT_TRIGGER_DEPTH = 10;
568 enum SQLITE_LIMIT_WORKER_THREADS = 11;
569 
570 enum SQLITE_PREPARE_PERSISTENT = 0x01;
571 enum SQLITE_PREPARE_NORMALIZE = 0x02;
572 enum SQLITE_PREPARE_NO_VTAB = 0x04;
573 
574 int sqlite3_prepare (
575     sqlite3* db,
576     const(char)* zSql,
577     int nByte,
578     sqlite3_stmt** ppStmt,
579     const(char*)* pzTail);
580 int sqlite3_prepare_v2 (
581     sqlite3* db,
582     const(char)* zSql,
583     int nByte,
584     sqlite3_stmt** ppStmt,
585     const(char*)* pzTail);
586 int sqlite3_prepare_v3 (
587     sqlite3* db,
588     const(char)* zSql,
589     int nByte,
590     uint prepFlags,
591     sqlite3_stmt** ppStmt,
592     const(char*)* pzTail);
593 int sqlite3_prepare16 (
594     sqlite3* db,
595     const(void)* zSql,
596     int nByte,
597     sqlite3_stmt** ppStmt,
598     const(void*)* pzTail);
599 int sqlite3_prepare16_v2 (
600     sqlite3* db,
601     const(void)* zSql,
602     int nByte,
603     sqlite3_stmt** ppStmt,
604     const(void*)* pzTail);
605 int sqlite3_prepare16_v3 (
606     sqlite3* db,
607     const(void)* zSql,
608     int nByte,
609     uint prepFlags,
610     sqlite3_stmt** ppStmt,
611     const(void*)* pzTail);
612 
613 const(char)* sqlite3_sql (sqlite3_stmt* pStmt);
614 char* sqlite3_expanded_sql (sqlite3_stmt* pStmt);
615 
616 int sqlite3_stmt_readonly (sqlite3_stmt* pStmt);
617 
618 int sqlite3_stmt_isexplain (sqlite3_stmt* pStmt);
619 
620 int sqlite3_stmt_explain (sqlite3_stmt* pStmt, int eMode);
621 
622 int sqlite3_stmt_busy (sqlite3_stmt*);
623 
624 struct sqlite3_value;
625 
626 struct sqlite3_context;
627 
628 int sqlite3_bind_blob (sqlite3_stmt*, int, const(void)*, int n, void function (void*));
629 int sqlite3_bind_blob64 (
630     sqlite3_stmt*,
631     int,
632     const(void)*,
633     sqlite3_uint64,
634     void function (void*));
635 int sqlite3_bind_double (sqlite3_stmt*, int, double);
636 int sqlite3_bind_int (sqlite3_stmt*, int, int);
637 int sqlite3_bind_int64 (sqlite3_stmt*, int, sqlite3_int64);
638 int sqlite3_bind_null (sqlite3_stmt*, int);
639 int sqlite3_bind_text (sqlite3_stmt*, int, const(char)*, int, void function (void*));
640 int sqlite3_bind_text16 (sqlite3_stmt*, int, const(void)*, int, void function (void*));
641 int sqlite3_bind_text64 (
642     sqlite3_stmt*,
643     int,
644     const(char)*,
645     sqlite3_uint64,
646     void function (void*),
647     ubyte encoding);
648 int sqlite3_bind_value (sqlite3_stmt*, int, const(sqlite3_value)*);
649 int sqlite3_bind_pointer (sqlite3_stmt*, int, void*, const(char)*, void function (void*));
650 int sqlite3_bind_zeroblob (sqlite3_stmt*, int, int n);
651 int sqlite3_bind_zeroblob64 (sqlite3_stmt*, int, sqlite3_uint64);
652 
653 int sqlite3_bind_parameter_count (sqlite3_stmt*);
654 
655 const(char)* sqlite3_bind_parameter_name (sqlite3_stmt*, int);
656 
657 int sqlite3_bind_parameter_index (sqlite3_stmt*, const(char)* zName);
658 
659 int sqlite3_clear_bindings (sqlite3_stmt*);
660 
661 int sqlite3_column_count (sqlite3_stmt* pStmt);
662 
663 const(char)* sqlite3_column_name (sqlite3_stmt*, int N);
664 const(void)* sqlite3_column_name16 (sqlite3_stmt*, int N);
665 
666 const(char)* sqlite3_column_database_name (sqlite3_stmt*, int);
667 const(void)* sqlite3_column_database_name16 (sqlite3_stmt*, int);
668 const(char)* sqlite3_column_table_name (sqlite3_stmt*, int);
669 const(void)* sqlite3_column_table_name16 (sqlite3_stmt*, int);
670 const(char)* sqlite3_column_origin_name (sqlite3_stmt*, int);
671 const(void)* sqlite3_column_origin_name16 (sqlite3_stmt*, int);
672 
673 const(char)* sqlite3_column_decltype (sqlite3_stmt*, int);
674 const(void)* sqlite3_column_decltype16 (sqlite3_stmt*, int);
675 
676 int sqlite3_step (sqlite3_stmt*);
677 
678 int sqlite3_data_count (sqlite3_stmt* pStmt);
679 
680 enum SQLITE_INTEGER = 1;
681 enum SQLITE_FLOAT = 2;
682 enum SQLITE_BLOB = 4;
683 enum SQLITE_NULL = 5;
684 
685 enum SQLITE_TEXT = 3;
686 
687 enum SQLITE3_TEXT = 3;
688 
689 const(void)* sqlite3_column_blob (sqlite3_stmt*, int iCol);
690 double sqlite3_column_double (sqlite3_stmt*, int iCol);
691 int sqlite3_column_int (sqlite3_stmt*, int iCol);
692 sqlite3_int64 sqlite3_column_int64 (sqlite3_stmt*, int iCol);
693 const(ubyte)* sqlite3_column_text (sqlite3_stmt*, int iCol);
694 const(void)* sqlite3_column_text16 (sqlite3_stmt*, int iCol);
695 sqlite3_value* sqlite3_column_value (sqlite3_stmt*, int iCol);
696 int sqlite3_column_bytes (sqlite3_stmt*, int iCol);
697 int sqlite3_column_bytes16 (sqlite3_stmt*, int iCol);
698 int sqlite3_column_type (sqlite3_stmt*, int iCol);
699 
700 int sqlite3_finalize (sqlite3_stmt* pStmt);
701 
702 int sqlite3_reset (sqlite3_stmt* pStmt);
703 
704 int sqlite3_create_function (
705     sqlite3* db,
706     const(char)* zFunctionName,
707     int nArg,
708     int eTextRep,
709     void* pApp,
710     void function (sqlite3_context*, int, sqlite3_value**) xFunc,
711     void function (sqlite3_context*, int, sqlite3_value**) xStep,
712     void function (sqlite3_context*) xFinal);
713 int sqlite3_create_function16 (
714     sqlite3* db,
715     const(void)* zFunctionName,
716     int nArg,
717     int eTextRep,
718     void* pApp,
719     void function (sqlite3_context*, int, sqlite3_value**) xFunc,
720     void function (sqlite3_context*, int, sqlite3_value**) xStep,
721     void function (sqlite3_context*) xFinal);
722 int sqlite3_create_function_v2 (
723     sqlite3* db,
724     const(char)* zFunctionName,
725     int nArg,
726     int eTextRep,
727     void* pApp,
728     void function (sqlite3_context*, int, sqlite3_value**) xFunc,
729     void function (sqlite3_context*, int, sqlite3_value**) xStep,
730     void function (sqlite3_context*) xFinal,
731     void function (void*) xDestroy);
732 int sqlite3_create_window_function (
733     sqlite3* db,
734     const(char)* zFunctionName,
735     int nArg,
736     int eTextRep,
737     void* pApp,
738     void function (sqlite3_context*, int, sqlite3_value**) xStep,
739     void function (sqlite3_context*) xFinal,
740     void function (sqlite3_context*) xValue,
741     void function (sqlite3_context*, int, sqlite3_value**) xInverse,
742     void function (void*) xDestroy);
743 
744 enum SQLITE_UTF8 = 1;
745 enum SQLITE_UTF16LE = 2;
746 enum SQLITE_UTF16BE = 3;
747 enum SQLITE_UTF16 = 4;
748 enum SQLITE_ANY = 5;
749 enum SQLITE_UTF16_ALIGNED = 8;
750 
751 enum SQLITE_DETERMINISTIC = 0x000000800;
752 enum SQLITE_DIRECTONLY = 0x000080000;
753 enum SQLITE_SUBTYPE = 0x000100000;
754 enum SQLITE_INNOCUOUS = 0x000200000;
755 enum SQLITE_RESULT_SUBTYPE = 0x001000000;
756 
757 int sqlite3_aggregate_count (sqlite3_context*);
758 int sqlite3_expired (sqlite3_stmt*);
759 int sqlite3_transfer_bindings (sqlite3_stmt*, sqlite3_stmt*);
760 int sqlite3_global_recover ();
761 void sqlite3_thread_cleanup ();
762 int sqlite3_memory_alarm (
763     void function (void*, sqlite3_int64, int),
764     void*,
765     sqlite3_int64);
766 
767 const(void)* sqlite3_value_blob (sqlite3_value*);
768 double sqlite3_value_double (sqlite3_value*);
769 int sqlite3_value_int (sqlite3_value*);
770 sqlite3_int64 sqlite3_value_int64 (sqlite3_value*);
771 void* sqlite3_value_pointer (sqlite3_value*, const(char)*);
772 const(ubyte)* sqlite3_value_text (sqlite3_value*);
773 const(void)* sqlite3_value_text16 (sqlite3_value*);
774 const(void)* sqlite3_value_text16le (sqlite3_value*);
775 const(void)* sqlite3_value_text16be (sqlite3_value*);
776 int sqlite3_value_bytes (sqlite3_value*);
777 int sqlite3_value_bytes16 (sqlite3_value*);
778 int sqlite3_value_type (sqlite3_value*);
779 int sqlite3_value_numeric_type (sqlite3_value*);
780 int sqlite3_value_nochange (sqlite3_value*);
781 int sqlite3_value_frombind (sqlite3_value*);
782 
783 int sqlite3_value_encoding (sqlite3_value*);
784 
785 uint sqlite3_value_subtype (sqlite3_value*);
786 
787 sqlite3_value* sqlite3_value_dup (const(sqlite3_value)*);
788 void sqlite3_value_free (sqlite3_value*);
789 
790 void* sqlite3_aggregate_context (sqlite3_context*, int nBytes);
791 
792 void* sqlite3_user_data (sqlite3_context*);
793 
794 sqlite3* sqlite3_context_db_handle (sqlite3_context*);
795 
796 void* sqlite3_get_auxdata (sqlite3_context*, int N);
797 void sqlite3_set_auxdata (sqlite3_context*, int N, void*, void function (void*));
798 
799 void* sqlite3_get_clientdata (sqlite3*, const(char)*);
800 int sqlite3_set_clientdata (sqlite3*, const(char)*, void*, void function (void*));
801 
802 alias sqlite3_destructor_type = void function (void*);
803 enum SQLITE_STATIC = cast(sqlite3_destructor_type) 0;
804 enum SQLITE_TRANSIENT = cast(sqlite3_destructor_type) -1;
805 
806 void sqlite3_result_blob (sqlite3_context*, const(void)*, int, void function (void*));
807 void sqlite3_result_blob64 (
808     sqlite3_context*,
809     const(void)*,
810     sqlite3_uint64,
811     void function (void*));
812 void sqlite3_result_double (sqlite3_context*, double);
813 void sqlite3_result_error (sqlite3_context*, const(char)*, int);
814 void sqlite3_result_error16 (sqlite3_context*, const(void)*, int);
815 void sqlite3_result_error_toobig (sqlite3_context*);
816 void sqlite3_result_error_nomem (sqlite3_context*);
817 void sqlite3_result_error_code (sqlite3_context*, int);
818 void sqlite3_result_int (sqlite3_context*, int);
819 void sqlite3_result_int64 (sqlite3_context*, sqlite3_int64);
820 void sqlite3_result_null (sqlite3_context*);
821 void sqlite3_result_text (sqlite3_context*, const(char)*, int, void function (void*));
822 void sqlite3_result_text64 (
823     sqlite3_context*,
824     const(char)*,
825     sqlite3_uint64,
826     void function (void*),
827     ubyte encoding);
828 void sqlite3_result_text16 (sqlite3_context*, const(void)*, int, void function (void*));
829 void sqlite3_result_text16le (sqlite3_context*, const(void)*, int, void function (void*));
830 void sqlite3_result_text16be (sqlite3_context*, const(void)*, int, void function (void*));
831 void sqlite3_result_value (sqlite3_context*, sqlite3_value*);
832 void sqlite3_result_pointer (sqlite3_context*, void*, const(char)*, void function (void*));
833 void sqlite3_result_zeroblob (sqlite3_context*, int n);
834 int sqlite3_result_zeroblob64 (sqlite3_context*, sqlite3_uint64 n);
835 
836 void sqlite3_result_subtype (sqlite3_context*, uint);
837 
838 int sqlite3_create_collation (
839     sqlite3*,
840     const(char)* zName,
841     int eTextRep,
842     void* pArg,
843     int function (void*, int, const(void)*, int, const(void)*) xCompare);
844 int sqlite3_create_collation_v2 (
845     sqlite3*,
846     const(char)* zName,
847     int eTextRep,
848     void* pArg,
849     int function (void*, int, const(void)*, int, const(void)*) xCompare,
850     void function (void*) xDestroy);
851 int sqlite3_create_collation16 (
852     sqlite3*,
853     const(void)* zName,
854     int eTextRep,
855     void* pArg,
856     int function (void*, int, const(void)*, int, const(void)*) xCompare);
857 
858 int sqlite3_collation_needed (
859     sqlite3*,
860     void*,
861     void function (void*, sqlite3*, int eTextRep, const(char)*));
862 int sqlite3_collation_needed16 (
863     sqlite3*,
864     void*,
865     void function (void*, sqlite3*, int eTextRep, const(void)*));
866 
867 int sqlite3_sleep (int);
868 
869 extern __gshared char* sqlite3_temp_directory;
870 
871 extern __gshared char* sqlite3_data_directory;
872 
873 int sqlite3_win32_set_directory (c_ulong type, void* zValue);
874 int sqlite3_win32_set_directory8 (c_ulong type, const(char)* zValue);
875 int sqlite3_win32_set_directory16 (c_ulong type, const(void)* zValue);
876 
877 enum SQLITE_WIN32_DATA_DIRECTORY_TYPE = 1;
878 enum SQLITE_WIN32_TEMP_DIRECTORY_TYPE = 2;
879 
880 int sqlite3_get_autocommit (sqlite3*);
881 
882 sqlite3* sqlite3_db_handle (sqlite3_stmt*);
883 
884 const(char)* sqlite3_db_name (sqlite3* db, int N);
885 
886 sqlite3_filename sqlite3_db_filename (sqlite3* db, const(char)* zDbName);
887 
888 int sqlite3_db_readonly (sqlite3* db, const(char)* zDbName);
889 
890 int sqlite3_txn_state (sqlite3*, const(char)* zSchema);
891 
892 enum SQLITE_TXN_NONE = 0;
893 enum SQLITE_TXN_READ = 1;
894 enum SQLITE_TXN_WRITE = 2;
895 
896 sqlite3_stmt* sqlite3_next_stmt (sqlite3* pDb, sqlite3_stmt* pStmt);
897 
898 void* sqlite3_commit_hook (sqlite3*, int function (void*), void*);
899 void* sqlite3_rollback_hook (sqlite3*, void function (void*), void*);
900 
901 int sqlite3_autovacuum_pages (
902     sqlite3* db,
903     uint function (void*, const(char)*, uint, uint, uint),
904     void*,
905     void function (void*));
906 
907 void* sqlite3_update_hook (
908     sqlite3*,
909     void function (void*, int, const(char)*, const(char)*, sqlite3_int64),
910     void*);
911 
912 int sqlite3_enable_shared_cache (int);
913 
914 int sqlite3_release_memory (int);
915 
916 int sqlite3_db_release_memory (sqlite3*);
917 
918 sqlite3_int64 sqlite3_soft_heap_limit64 (sqlite3_int64 N);
919 sqlite3_int64 sqlite3_hard_heap_limit64 (sqlite3_int64 N);
920 
921 void sqlite3_soft_heap_limit (int N);
922 
923 int sqlite3_table_column_metadata (
924     sqlite3* db,
925     const(char)* zDbName,
926     const(char)* zTableName,
927     const(char)* zColumnName,
928     const(char*)* pzDataType,
929     const(char*)* pzCollSeq,
930     int* pNotNull,
931     int* pPrimaryKey,
932     int* pAutoinc);
933 
934 int sqlite3_load_extension (
935     sqlite3* db,
936     const(char)* zFile,
937     const(char)* zProc,
938     char** pzErrMsg);
939 
940 int sqlite3_enable_load_extension (sqlite3* db, int onoff);
941 
942 int sqlite3_auto_extension (void function () xEntryPoint);
943 
944 int sqlite3_cancel_auto_extension (void function () xEntryPoint);
945 
946 void sqlite3_reset_auto_extension ();
947 
948 struct sqlite3_module
949 {
950     int iVersion;
951     int function (
952         sqlite3*,
953         void* pAux,
954         int argc,
955         const(char*)* argv,
956         sqlite3_vtab** ppVTab,
957         char**) xCreate;
958     int function (
959         sqlite3*,
960         void* pAux,
961         int argc,
962         const(char*)* argv,
963         sqlite3_vtab** ppVTab,
964         char**) xConnect;
965     int function (sqlite3_vtab* pVTab, sqlite3_index_info*) xBestIndex;
966     int function (sqlite3_vtab* pVTab) xDisconnect;
967     int function (sqlite3_vtab* pVTab) xDestroy;
968     int function (sqlite3_vtab* pVTab, sqlite3_vtab_cursor** ppCursor) xOpen;
969     int function (sqlite3_vtab_cursor*) xClose;
970     int function (
971         sqlite3_vtab_cursor*,
972         int idxNum,
973         const(char)* idxStr,
974         int argc,
975         sqlite3_value** argv) xFilter;
976     int function (sqlite3_vtab_cursor*) xNext;
977     int function (sqlite3_vtab_cursor*) xEof;
978     int function (sqlite3_vtab_cursor*, sqlite3_context*, int) xColumn;
979     int function (sqlite3_vtab_cursor*, sqlite3_int64* pRowid) xRowid;
980     int function (sqlite3_vtab*, int, sqlite3_value**, sqlite3_int64*) xUpdate;
981     int function (sqlite3_vtab* pVTab) xBegin;
982     int function (sqlite3_vtab* pVTab) xSync;
983     int function (sqlite3_vtab* pVTab) xCommit;
984     int function (sqlite3_vtab* pVTab) xRollback;
985     int function (
986         sqlite3_vtab* pVtab,
987         int nArg,
988         const(char)* zName,
989         void function (sqlite3_context*, int, sqlite3_value**)* pxFunc,
990         void** ppArg) xFindFunction;
991     int function (sqlite3_vtab* pVtab, const(char)* zNew) xRename;
992 
993     int function (sqlite3_vtab* pVTab, int) xSavepoint;
994     int function (sqlite3_vtab* pVTab, int) xRelease;
995     int function (sqlite3_vtab* pVTab, int) xRollbackTo;
996 
997     int function (const(char)*) xShadowName;
998 
999     int function (
1000         sqlite3_vtab* pVTab,
1001         const(char)* zSchema,
1002         const(char)* zTabName,
1003         int mFlags,
1004         char** pzErr) xIntegrity;
1005 }
1006 
1007 struct sqlite3_index_info
1008 {
1009     int nConstraint;
1010 
1011     struct sqlite3_index_constraint
1012     {
1013         int iColumn;
1014         ubyte op;
1015         ubyte usable;
1016         int iTermOffset;
1017     }
1018 
1019     sqlite3_index_constraint* aConstraint;
1020     int nOrderBy;
1021 
1022     struct sqlite3_index_orderby
1023     {
1024         int iColumn;
1025         ubyte desc;
1026     }
1027 
1028     sqlite3_index_orderby* aOrderBy;
1029 
1030     struct sqlite3_index_constraint_usage
1031     {
1032         int argvIndex;
1033         ubyte omit;
1034     }
1035 
1036     sqlite3_index_constraint_usage* aConstraintUsage;
1037     int idxNum;
1038     char* idxStr;
1039     int needToFreeIdxStr;
1040     int orderByConsumed;
1041     double estimatedCost;
1042 
1043     sqlite3_int64 estimatedRows;
1044 
1045     int idxFlags;
1046 
1047     sqlite3_uint64 colUsed;
1048 }
1049 
1050 enum SQLITE_INDEX_SCAN_UNIQUE = 1;
1051 
1052 enum SQLITE_INDEX_CONSTRAINT_EQ = 2;
1053 enum SQLITE_INDEX_CONSTRAINT_GT = 4;
1054 enum SQLITE_INDEX_CONSTRAINT_LE = 8;
1055 enum SQLITE_INDEX_CONSTRAINT_LT = 16;
1056 enum SQLITE_INDEX_CONSTRAINT_GE = 32;
1057 enum SQLITE_INDEX_CONSTRAINT_MATCH = 64;
1058 enum SQLITE_INDEX_CONSTRAINT_LIKE = 65;
1059 enum SQLITE_INDEX_CONSTRAINT_GLOB = 66;
1060 enum SQLITE_INDEX_CONSTRAINT_REGEXP = 67;
1061 enum SQLITE_INDEX_CONSTRAINT_NE = 68;
1062 enum SQLITE_INDEX_CONSTRAINT_ISNOT = 69;
1063 enum SQLITE_INDEX_CONSTRAINT_ISNOTNULL = 70;
1064 enum SQLITE_INDEX_CONSTRAINT_ISNULL = 71;
1065 enum SQLITE_INDEX_CONSTRAINT_IS = 72;
1066 enum SQLITE_INDEX_CONSTRAINT_LIMIT = 73;
1067 enum SQLITE_INDEX_CONSTRAINT_OFFSET = 74;
1068 enum SQLITE_INDEX_CONSTRAINT_FUNCTION = 150;
1069 
1070 int sqlite3_create_module (
1071     sqlite3* db,
1072     const(char)* zName,
1073     const(sqlite3_module)* p,
1074     void* pClientData);
1075 int sqlite3_create_module_v2 (
1076     sqlite3* db,
1077     const(char)* zName,
1078     const(sqlite3_module)* p,
1079     void* pClientData,
1080     void function (void*) xDestroy);
1081 
1082 int sqlite3_drop_modules (sqlite3* db, const(char*)* azKeep);
1083 
1084 struct sqlite3_vtab
1085 {
1086     const(sqlite3_module)* pModule;
1087     int nRef;
1088     char* zErrMsg;
1089 }
1090 
1091 struct sqlite3_vtab_cursor
1092 {
1093     sqlite3_vtab* pVtab;
1094 }
1095 
1096 int sqlite3_declare_vtab (sqlite3*, const(char)* zSQL);
1097 
1098 int sqlite3_overload_function (sqlite3*, const(char)* zFuncName, int nArg);
1099 
1100 struct sqlite3_blob;
1101 
1102 int sqlite3_blob_open (
1103     sqlite3*,
1104     const(char)* zDb,
1105     const(char)* zTable,
1106     const(char)* zColumn,
1107     sqlite3_int64 iRow,
1108     int flags,
1109     sqlite3_blob** ppBlob);
1110 
1111 int sqlite3_blob_reopen (sqlite3_blob*, sqlite3_int64);
1112 
1113 int sqlite3_blob_close (sqlite3_blob*);
1114 
1115 int sqlite3_blob_bytes (sqlite3_blob*);
1116 
1117 int sqlite3_blob_read (sqlite3_blob*, void* Z, int N, int iOffset);
1118 
1119 int sqlite3_blob_write (sqlite3_blob*, const(void)* z, int n, int iOffset);
1120 
1121 sqlite3_vfs* sqlite3_vfs_find (const(char)* zVfsName);
1122 int sqlite3_vfs_register (sqlite3_vfs*, int makeDflt);
1123 int sqlite3_vfs_unregister (sqlite3_vfs*);
1124 
1125 sqlite3_mutex* sqlite3_mutex_alloc (int);
1126 void sqlite3_mutex_free (sqlite3_mutex*);
1127 void sqlite3_mutex_enter (sqlite3_mutex*);
1128 int sqlite3_mutex_try (sqlite3_mutex*);
1129 void sqlite3_mutex_leave (sqlite3_mutex*);
1130 
1131 struct sqlite3_mutex_methods
1132 {
1133     int function () xMutexInit;
1134     int function () xMutexEnd;
1135     sqlite3_mutex* function (int) xMutexAlloc;
1136     void function (sqlite3_mutex*) xMutexFree;
1137     void function (sqlite3_mutex*) xMutexEnter;
1138     int function (sqlite3_mutex*) xMutexTry;
1139     void function (sqlite3_mutex*) xMutexLeave;
1140     int function (sqlite3_mutex*) xMutexHeld;
1141     int function (sqlite3_mutex*) xMutexNotheld;
1142 }
1143 
1144 int sqlite3_mutex_held (sqlite3_mutex*);
1145 int sqlite3_mutex_notheld (sqlite3_mutex*);
1146 
1147 enum SQLITE_MUTEX_FAST = 0;
1148 enum SQLITE_MUTEX_RECURSIVE = 1;
1149 enum SQLITE_MUTEX_STATIC_MAIN = 2;
1150 enum SQLITE_MUTEX_STATIC_MEM = 3;
1151 enum SQLITE_MUTEX_STATIC_MEM2 = 4;
1152 enum SQLITE_MUTEX_STATIC_OPEN = 4;
1153 enum SQLITE_MUTEX_STATIC_PRNG = 5;
1154 enum SQLITE_MUTEX_STATIC_LRU = 6;
1155 enum SQLITE_MUTEX_STATIC_LRU2 = 7;
1156 enum SQLITE_MUTEX_STATIC_PMEM = 7;
1157 enum SQLITE_MUTEX_STATIC_APP1 = 8;
1158 enum SQLITE_MUTEX_STATIC_APP2 = 9;
1159 enum SQLITE_MUTEX_STATIC_APP3 = 10;
1160 enum SQLITE_MUTEX_STATIC_VFS1 = 11;
1161 enum SQLITE_MUTEX_STATIC_VFS2 = 12;
1162 enum SQLITE_MUTEX_STATIC_VFS3 = 13;
1163 
1164 enum SQLITE_MUTEX_STATIC_MASTER = 2;
1165 
1166 sqlite3_mutex* sqlite3_db_mutex (sqlite3*);
1167 
1168 int sqlite3_file_control (sqlite3*, const(char)* zDbName, int op, void*);
1169 
1170 int sqlite3_test_control (int op, ...);
1171 
1172 enum SQLITE_TESTCTRL_FIRST = 5;
1173 enum SQLITE_TESTCTRL_PRNG_SAVE = 5;
1174 enum SQLITE_TESTCTRL_PRNG_RESTORE = 6;
1175 enum SQLITE_TESTCTRL_PRNG_RESET = 7;
1176 enum SQLITE_TESTCTRL_FK_NO_ACTION = 7;
1177 enum SQLITE_TESTCTRL_BITVEC_TEST = 8;
1178 enum SQLITE_TESTCTRL_FAULT_INSTALL = 9;
1179 enum SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS = 10;
1180 enum SQLITE_TESTCTRL_PENDING_BYTE = 11;
1181 enum SQLITE_TESTCTRL_ASSERT = 12;
1182 enum SQLITE_TESTCTRL_ALWAYS = 13;
1183 enum SQLITE_TESTCTRL_RESERVE = 14;
1184 enum SQLITE_TESTCTRL_JSON_SELFCHECK = 14;
1185 enum SQLITE_TESTCTRL_OPTIMIZATIONS = 15;
1186 enum SQLITE_TESTCTRL_ISKEYWORD = 16;
1187 enum SQLITE_TESTCTRL_SCRATCHMALLOC = 17;
1188 enum SQLITE_TESTCTRL_INTERNAL_FUNCTIONS = 17;
1189 enum SQLITE_TESTCTRL_LOCALTIME_FAULT = 18;
1190 enum SQLITE_TESTCTRL_EXPLAIN_STMT = 19;
1191 enum SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD = 19;
1192 enum SQLITE_TESTCTRL_NEVER_CORRUPT = 20;
1193 enum SQLITE_TESTCTRL_VDBE_COVERAGE = 21;
1194 enum SQLITE_TESTCTRL_BYTEORDER = 22;
1195 enum SQLITE_TESTCTRL_ISINIT = 23;
1196 enum SQLITE_TESTCTRL_SORTER_MMAP = 24;
1197 enum SQLITE_TESTCTRL_IMPOSTER = 25;
1198 enum SQLITE_TESTCTRL_PARSER_COVERAGE = 26;
1199 enum SQLITE_TESTCTRL_RESULT_INTREAL = 27;
1200 enum SQLITE_TESTCTRL_PRNG_SEED = 28;
1201 enum SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS = 29;
1202 enum SQLITE_TESTCTRL_SEEK_COUNT = 30;
1203 enum SQLITE_TESTCTRL_TRACEFLAGS = 31;
1204 enum SQLITE_TESTCTRL_TUNE = 32;
1205 enum SQLITE_TESTCTRL_LOGEST = 33;
1206 enum SQLITE_TESTCTRL_USELONGDOUBLE = 34;
1207 enum SQLITE_TESTCTRL_LAST = 34;
1208 
1209 int sqlite3_keyword_count ();
1210 int sqlite3_keyword_name (int, const(char*)*, int*);
1211 int sqlite3_keyword_check (const(char)*, int);
1212 
1213 struct sqlite3_str;
1214 
1215 sqlite3_str* sqlite3_str_new (sqlite3*);
1216 
1217 char* sqlite3_str_finish (sqlite3_str*);
1218 
1219 void sqlite3_str_appendf (sqlite3_str*, const(char)* zFormat, ...);
1220 void sqlite3_str_vappendf (sqlite3_str*, const(char)* zFormat, va_list);
1221 void sqlite3_str_append (sqlite3_str*, const(char)* zIn, int N);
1222 void sqlite3_str_appendall (sqlite3_str*, const(char)* zIn);
1223 void sqlite3_str_appendchar (sqlite3_str*, int N, char C);
1224 void sqlite3_str_reset (sqlite3_str*);
1225 
1226 int sqlite3_str_errcode (sqlite3_str*);
1227 int sqlite3_str_length (sqlite3_str*);
1228 char* sqlite3_str_value (sqlite3_str*);
1229 
1230 int sqlite3_status (int op, int* pCurrent, int* pHighwater, int resetFlag);
1231 int sqlite3_status64 (
1232     int op,
1233     sqlite3_int64* pCurrent,
1234     sqlite3_int64* pHighwater,
1235     int resetFlag);
1236 
1237 enum SQLITE_STATUS_MEMORY_USED = 0;
1238 enum SQLITE_STATUS_PAGECACHE_USED = 1;
1239 enum SQLITE_STATUS_PAGECACHE_OVERFLOW = 2;
1240 enum SQLITE_STATUS_SCRATCH_USED = 3;
1241 enum SQLITE_STATUS_SCRATCH_OVERFLOW = 4;
1242 enum SQLITE_STATUS_MALLOC_SIZE = 5;
1243 enum SQLITE_STATUS_PARSER_STACK = 6;
1244 enum SQLITE_STATUS_PAGECACHE_SIZE = 7;
1245 enum SQLITE_STATUS_SCRATCH_SIZE = 8;
1246 enum SQLITE_STATUS_MALLOC_COUNT = 9;
1247 
1248 int sqlite3_db_status (sqlite3*, int op, int* pCur, int* pHiwtr, int resetFlg);
1249 
1250 enum SQLITE_DBSTATUS_LOOKASIDE_USED = 0;
1251 enum SQLITE_DBSTATUS_CACHE_USED = 1;
1252 enum SQLITE_DBSTATUS_SCHEMA_USED = 2;
1253 enum SQLITE_DBSTATUS_STMT_USED = 3;
1254 enum SQLITE_DBSTATUS_LOOKASIDE_HIT = 4;
1255 enum SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE = 5;
1256 enum SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL = 6;
1257 enum SQLITE_DBSTATUS_CACHE_HIT = 7;
1258 enum SQLITE_DBSTATUS_CACHE_MISS = 8;
1259 enum SQLITE_DBSTATUS_CACHE_WRITE = 9;
1260 enum SQLITE_DBSTATUS_DEFERRED_FKS = 10;
1261 enum SQLITE_DBSTATUS_CACHE_USED_SHARED = 11;
1262 enum SQLITE_DBSTATUS_CACHE_SPILL = 12;
1263 enum SQLITE_DBSTATUS_MAX = 12;
1264 
1265 int sqlite3_stmt_status (sqlite3_stmt*, int op, int resetFlg);
1266 
1267 enum SQLITE_STMTSTATUS_FULLSCAN_STEP = 1;
1268 enum SQLITE_STMTSTATUS_SORT = 2;
1269 enum SQLITE_STMTSTATUS_AUTOINDEX = 3;
1270 enum SQLITE_STMTSTATUS_VM_STEP = 4;
1271 enum SQLITE_STMTSTATUS_REPREPARE = 5;
1272 enum SQLITE_STMTSTATUS_RUN = 6;
1273 enum SQLITE_STMTSTATUS_FILTER_MISS = 7;
1274 enum SQLITE_STMTSTATUS_FILTER_HIT = 8;
1275 enum SQLITE_STMTSTATUS_MEMUSED = 99;
1276 
1277 struct sqlite3_pcache;
1278 
1279 struct sqlite3_pcache_page
1280 {
1281     void* pBuf;
1282     void* pExtra;
1283 }
1284 
1285 struct sqlite3_pcache_methods2
1286 {
1287     int iVersion;
1288     void* pArg;
1289     int function (void*) xInit;
1290     void function (void*) xShutdown;
1291     sqlite3_pcache* function (int szPage, int szExtra, int bPurgeable) xCreate;
1292     void function (sqlite3_pcache*, int nCachesize) xCachesize;
1293     int function (sqlite3_pcache*) xPagecount;
1294     sqlite3_pcache_page* function (sqlite3_pcache*, uint key, int createFlag) xFetch;
1295     void function (sqlite3_pcache*, sqlite3_pcache_page*, int discard) xUnpin;
1296     void function (
1297         sqlite3_pcache*,
1298         sqlite3_pcache_page*,
1299         uint oldKey,
1300         uint newKey) xRekey;
1301     void function (sqlite3_pcache*, uint iLimit) xTruncate;
1302     void function (sqlite3_pcache*) xDestroy;
1303     void function (sqlite3_pcache*) xShrink;
1304 }
1305 
1306 struct sqlite3_pcache_methods
1307 {
1308     void* pArg;
1309     int function (void*) xInit;
1310     void function (void*) xShutdown;
1311     sqlite3_pcache* function (int szPage, int bPurgeable) xCreate;
1312     void function (sqlite3_pcache*, int nCachesize) xCachesize;
1313     int function (sqlite3_pcache*) xPagecount;
1314     void* function (sqlite3_pcache*, uint key, int createFlag) xFetch;
1315     void function (sqlite3_pcache*, void*, int discard) xUnpin;
1316     void function (sqlite3_pcache*, void*, uint oldKey, uint newKey) xRekey;
1317     void function (sqlite3_pcache*, uint iLimit) xTruncate;
1318     void function (sqlite3_pcache*) xDestroy;
1319 }
1320 
1321 struct sqlite3_backup;
1322 
1323 sqlite3_backup* sqlite3_backup_init (
1324     sqlite3* pDest,
1325     const(char)* zDestName,
1326     sqlite3* pSource,
1327     const(char)* zSourceName);
1328 int sqlite3_backup_step (sqlite3_backup* p, int nPage);
1329 int sqlite3_backup_finish (sqlite3_backup* p);
1330 int sqlite3_backup_remaining (sqlite3_backup* p);
1331 int sqlite3_backup_pagecount (sqlite3_backup* p);
1332 
1333 int sqlite3_unlock_notify (
1334     sqlite3* pBlocked,
1335     void function (void** apArg, int nArg) xNotify,
1336     void* pNotifyArg);
1337 
1338 int sqlite3_stricmp (const(char)*, const(char)*);
1339 int sqlite3_strnicmp (const(char)*, const(char)*, int);
1340 
1341 int sqlite3_strglob (const(char)* zGlob, const(char)* zStr);
1342 
1343 int sqlite3_strlike (const(char)* zGlob, const(char)* zStr, uint cEsc);
1344 
1345 void sqlite3_log (int iErrCode, const(char)* zFormat, ...);
1346 
1347 void* sqlite3_wal_hook (
1348     sqlite3*,
1349     int function (void*, sqlite3*, const(char)*, int),
1350     void*);
1351 
1352 int sqlite3_wal_autocheckpoint (sqlite3* db, int N);
1353 
1354 int sqlite3_wal_checkpoint (sqlite3* db, const(char)* zDb);
1355 
1356 int sqlite3_wal_checkpoint_v2 (
1357     sqlite3* db,
1358     const(char)* zDb,
1359     int eMode,
1360     int* pnLog,
1361     int* pnCkpt);
1362 
1363 enum SQLITE_CHECKPOINT_PASSIVE = 0;
1364 enum SQLITE_CHECKPOINT_FULL = 1;
1365 enum SQLITE_CHECKPOINT_RESTART = 2;
1366 enum SQLITE_CHECKPOINT_TRUNCATE = 3;
1367 
1368 int sqlite3_vtab_config (sqlite3*, int op, ...);
1369 
1370 enum SQLITE_VTAB_CONSTRAINT_SUPPORT = 1;
1371 enum SQLITE_VTAB_INNOCUOUS = 2;
1372 enum SQLITE_VTAB_DIRECTONLY = 3;
1373 enum SQLITE_VTAB_USES_ALL_SCHEMAS = 4;
1374 
1375 int sqlite3_vtab_on_conflict (sqlite3*);
1376 
1377 int sqlite3_vtab_nochange (sqlite3_context*);
1378 
1379 const(char)* sqlite3_vtab_collation (sqlite3_index_info*, int);
1380 
1381 int sqlite3_vtab_distinct (sqlite3_index_info*);
1382 
1383 int sqlite3_vtab_in (sqlite3_index_info*, int iCons, int bHandle);
1384 
1385 int sqlite3_vtab_in_first (sqlite3_value* pVal, sqlite3_value** ppOut);
1386 int sqlite3_vtab_in_next (sqlite3_value* pVal, sqlite3_value** ppOut);
1387 
1388 int sqlite3_vtab_rhs_value (sqlite3_index_info*, int, sqlite3_value** ppVal);
1389 
1390 enum SQLITE_ROLLBACK = 1;
1391 
1392 enum SQLITE_FAIL = 3;
1393 
1394 enum SQLITE_REPLACE = 5;
1395 
1396 enum SQLITE_SCANSTAT_NLOOP = 0;
1397 enum SQLITE_SCANSTAT_NVISIT = 1;
1398 enum SQLITE_SCANSTAT_EST = 2;
1399 enum SQLITE_SCANSTAT_NAME = 3;
1400 enum SQLITE_SCANSTAT_EXPLAIN = 4;
1401 enum SQLITE_SCANSTAT_SELECTID = 5;
1402 enum SQLITE_SCANSTAT_PARENTID = 6;
1403 enum SQLITE_SCANSTAT_NCYCLE = 7;
1404 
1405 int sqlite3_stmt_scanstatus (
1406     sqlite3_stmt* pStmt,
1407     int idx,
1408     int iScanStatusOp,
1409     void* pOut);
1410 int sqlite3_stmt_scanstatus_v2 (
1411     sqlite3_stmt* pStmt,
1412     int idx,
1413     int iScanStatusOp,
1414     int flags,
1415     void* pOut);
1416 
1417 enum SQLITE_SCANSTAT_COMPLEX = 0x0001;
1418 
1419 void sqlite3_stmt_scanstatus_reset (sqlite3_stmt*);
1420 
1421 int sqlite3_db_cacheflush (sqlite3*);
1422 
1423 int sqlite3_system_errno (sqlite3*);
1424 
1425 struct sqlite3_snapshot
1426 {
1427     ubyte[48] hidden;
1428 }
1429 
1430 int sqlite3_snapshot_get (
1431     sqlite3* db,
1432     const(char)* zSchema,
1433     sqlite3_snapshot** ppSnapshot);
1434 
1435 int sqlite3_snapshot_open (
1436     sqlite3* db,
1437     const(char)* zSchema,
1438     sqlite3_snapshot* pSnapshot);
1439 
1440 void sqlite3_snapshot_free (sqlite3_snapshot*);
1441 
1442 int sqlite3_snapshot_cmp (sqlite3_snapshot* p1, sqlite3_snapshot* p2);
1443 
1444 int sqlite3_snapshot_recover (sqlite3* db, const(char)* zDb);
1445 
1446 ubyte* sqlite3_serialize (
1447     sqlite3* db,
1448     const(char)* zSchema,
1449     sqlite3_int64* piSize,
1450     uint mFlags);
1451 
1452 enum SQLITE_SERIALIZE_NOCOPY = 0x001;
1453 
1454 int sqlite3_deserialize (
1455     sqlite3* db,
1456     const(char)* zSchema,
1457     ubyte* pData,
1458     sqlite3_int64 szDb,
1459     sqlite3_int64 szBuf,
1460     uint mFlags);
1461 
1462 enum SQLITE_DESERIALIZE_FREEONCLOSE = 1;
1463 enum SQLITE_DESERIALIZE_RESIZEABLE = 2;
1464 enum SQLITE_DESERIALIZE_READONLY = 4;
1465 
1466 alias sqlite3_rtree_dbl = double;
1467 
1468 int sqlite3_rtree_geometry_callback (
1469     sqlite3* db,
1470     const(char)* zGeom,
1471     int function (sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*, int*) xGeom,
1472     void* pContext);
1473 
1474 struct sqlite3_rtree_geometry
1475 {
1476     void* pContext;
1477     int nParam;
1478     sqlite3_rtree_dbl* aParam;
1479     void* pUser;
1480     void function (void*) xDelUser;
1481 }
1482 
1483 int sqlite3_rtree_query_callback (
1484     sqlite3* db,
1485     const(char)* zQueryFunc,
1486     int function (sqlite3_rtree_query_info*) xQueryFunc,
1487     void* pContext,
1488     void function (void*) xDestructor);
1489 
1490 struct sqlite3_rtree_query_info
1491 {
1492     void* pContext;
1493     int nParam;
1494     sqlite3_rtree_dbl* aParam;
1495     void* pUser;
1496     void function (void*) xDelUser;
1497     sqlite3_rtree_dbl* aCoord;
1498     uint* anQueue;
1499     int nCoord;
1500     int iLevel;
1501     int mxLevel;
1502     sqlite3_int64 iRowid;
1503     sqlite3_rtree_dbl rParentScore;
1504     int eParentWithin;
1505     int eWithin;
1506     sqlite3_rtree_dbl rScore;
1507 
1508     sqlite3_value** apSqlParam;
1509 }
1510 
1511 enum NOT_WITHIN = 0;
1512 enum PARTLY_WITHIN = 1;
1513 enum FULLY_WITHIN = 2;
1514 
1515 struct Fts5Context;
1516 
1517 alias fts5_extension_function = void function (
1518     const(Fts5ExtensionApi)* pApi,
1519     Fts5Context* pFts,
1520     sqlite3_context* pCtx,
1521     int nVal,
1522     sqlite3_value** apVal);
1523 
1524 struct Fts5PhraseIter
1525 {
1526     const(ubyte)* a;
1527     const(ubyte)* b;
1528 }
1529 
1530 struct Fts5ExtensionApi
1531 {
1532     int iVersion;
1533 
1534     void* function (Fts5Context*) xUserData;
1535 
1536     int function (Fts5Context*) xColumnCount;
1537     int function (Fts5Context*, sqlite3_int64* pnRow) xRowCount;
1538     int function (Fts5Context*, int iCol, sqlite3_int64* pnToken) xColumnTotalSize;
1539 
1540     int function (
1541         Fts5Context*,
1542         const(char)* pText,
1543         int nText,
1544         void* pCtx,
1545         int function (void*, int, const(char)*, int, int, int) xToken) xTokenize;
1546 
1547     int function (Fts5Context*) xPhraseCount;
1548     int function (Fts5Context*, int iPhrase) xPhraseSize;
1549 
1550     int function (Fts5Context*, int* pnInst) xInstCount;
1551     int function (Fts5Context*, int iIdx, int* piPhrase, int* piCol, int* piOff) xInst;
1552 
1553     sqlite3_int64 function (Fts5Context*) xRowid;
1554     int function (Fts5Context*, int iCol, const(char*)* pz, int* pn) xColumnText;
1555     int function (Fts5Context*, int iCol, int* pnToken) xColumnSize;
1556 
1557     int function (
1558         Fts5Context*,
1559         int iPhrase,
1560         void* pUserData,
1561         int function (const(Fts5ExtensionApi)*, Fts5Context*, void*)) xQueryPhrase;
1562     int function (Fts5Context*, void* pAux, void function (void*) xDelete) xSetAuxdata;
1563     void* function (Fts5Context*, int bClear) xGetAuxdata;
1564 
1565     int function (Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*) xPhraseFirst;
1566     void function (Fts5Context*, Fts5PhraseIter*, int* piCol, int* piOff) xPhraseNext;
1567 
1568     int function (Fts5Context*, int iPhrase, Fts5PhraseIter*, int*) xPhraseFirstColumn;
1569     void function (Fts5Context*, Fts5PhraseIter*, int* piCol) xPhraseNextColumn;
1570 
1571     int function (
1572         Fts5Context*,
1573         int iPhrase,
1574         int iToken,
1575         const(char*)* ppToken,
1576         int* pnToken) xQueryToken;
1577     int function (Fts5Context*, int iIdx, int iToken, const(char*)*, int*) xInstToken;
1578 }
1579 
1580 struct Fts5Tokenizer;
1581 
1582 struct fts5_tokenizer
1583 {
1584     int function (void*, const(char*)* azArg, int nArg, Fts5Tokenizer** ppOut) xCreate;
1585     void function (Fts5Tokenizer*) xDelete;
1586     int function (
1587         Fts5Tokenizer*,
1588         void* pCtx,
1589         int flags,
1590         const(char)* pText,
1591         int nText,
1592         int function (void* pCtx, int tflags, const(char)* pToken, int nToken, int iStart, int iEnd) xToken) xTokenize;
1593 }
1594 
1595 enum FTS5_TOKENIZE_QUERY = 0x0001;
1596 enum FTS5_TOKENIZE_PREFIX = 0x0002;
1597 enum FTS5_TOKENIZE_DOCUMENT = 0x0004;
1598 enum FTS5_TOKENIZE_AUX = 0x0008;
1599 
1600 enum FTS5_TOKEN_COLOCATED = 0x0001;
1601 
1602 struct fts5_api
1603 {
1604     int iVersion;
1605 
1606     int function (
1607         fts5_api* pApi,
1608         const(char)* zName,
1609         void* pUserData,
1610         fts5_tokenizer* pTokenizer,
1611         void function (void*) xDestroy) xCreateTokenizer;
1612 
1613     int function (
1614         fts5_api* pApi,
1615         const(char)* zName,
1616         void** ppUserData,
1617         fts5_tokenizer* pTokenizer) xFindTokenizer;
1618 
1619     int function (
1620         fts5_api* pApi,
1621         const(char)* zName,
1622         void* pUserData,
1623         fts5_extension_function xFunction,
1624         void function (void*) xDestroy) xCreateFunction;
1625 }