@evolu/sqlite-wasm 2.2.4 → 3.53.4-build1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +55 -218
  3. package/dist/src/CApi.d.ts +2108 -0
  4. package/dist/src/CApi.d.ts.map +1 -0
  5. package/dist/src/CApi.js +1919 -0
  6. package/dist/src/Constants.d.ts +868 -0
  7. package/dist/src/Constants.d.ts.map +1 -0
  8. package/dist/src/Constants.js +602 -0
  9. package/dist/src/Database.d.ts +641 -0
  10. package/dist/src/Database.d.ts.map +1 -0
  11. package/dist/src/Database.js +1177 -0
  12. package/dist/src/Memory.d.ts +119 -0
  13. package/dist/src/Memory.d.ts.map +1 -0
  14. package/dist/src/Memory.js +207 -0
  15. package/dist/src/Pointer.d.ts +100 -0
  16. package/dist/src/Pointer.d.ts.map +1 -0
  17. package/dist/src/Pointer.js +15 -0
  18. package/dist/src/SahPool.d.ts +744 -0
  19. package/dist/src/SahPool.d.ts.map +1 -0
  20. package/dist/src/SahPool.js +1985 -0
  21. package/dist/src/Wasm.d.ts +315 -0
  22. package/dist/src/Wasm.d.ts.map +1 -0
  23. package/dist/src/Wasm.js +756 -0
  24. package/dist/src/WasmUrl.d.ts +21 -0
  25. package/dist/src/WasmUrl.d.ts.map +1 -0
  26. package/dist/src/WasmUrl.js +20 -0
  27. package/dist/src/c-api/index.d.ts +9 -0
  28. package/dist/src/c-api/index.d.ts.map +1 -0
  29. package/dist/src/c-api/index.js +8 -0
  30. package/dist/src/index.d.ts +15 -0
  31. package/dist/src/index.d.ts.map +1 -0
  32. package/dist/src/index.js +13 -0
  33. package/dist/wasm/sqlite3.wasm +0 -0
  34. package/package.json +60 -60
  35. package/src/CApi.test.ts +217 -0
  36. package/src/CApi.ts +3294 -0
  37. package/src/Constants.ts +803 -0
  38. package/src/Database.ts +1714 -0
  39. package/src/Memory.test.ts +319 -0
  40. package/src/Memory.ts +237 -0
  41. package/src/Pointer.ts +121 -0
  42. package/src/SahPool.test.ts +180 -0
  43. package/src/SahPool.ts +2627 -0
  44. package/src/Wasm.test.ts +444 -0
  45. package/src/Wasm.ts +1026 -0
  46. package/src/WasmUrl.ts +26 -0
  47. package/src/c-api/index.ts +9 -0
  48. package/src/index.ts +15 -0
  49. package/bin/index.js +0 -110
  50. package/index.d.ts +0 -8118
  51. package/index.mjs +0 -7
  52. package/node.mjs +0 -3
  53. package/sqlite-wasm/jswasm/sqlite3-bundler-friendly.mjs +0 -13659
  54. package/sqlite-wasm/jswasm/sqlite3-node.mjs +0 -11671
  55. package/sqlite-wasm/jswasm/sqlite3-opfs-async-proxy.js +0 -691
  56. package/sqlite-wasm/jswasm/sqlite3-worker1-bundler-friendly.mjs +0 -35
  57. package/sqlite-wasm/jswasm/sqlite3-worker1-promiser.js +0 -193
  58. package/sqlite-wasm/jswasm/sqlite3-worker1-promiser.mjs +0 -187
  59. package/sqlite-wasm/jswasm/sqlite3-worker1.js +0 -46
  60. package/sqlite-wasm/jswasm/sqlite3.js +0 -13697
  61. package/sqlite-wasm/jswasm/sqlite3.mjs +0 -13661
  62. package/sqlite-wasm/jswasm/sqlite3.wasm +0 -0
@@ -0,0 +1,1919 @@
1
+ /**
2
+ * SQLite's C API as standalone functions: one for every public C function the
3
+ * binary exports, and one for each of the variadic {@link sqlite3_config},
4
+ * {@link sqlite3_db_config} and {@link sqlite3_vtab_config}, which the binary
5
+ * exports only as the build's `sqlite3__wasm_*` shims.
6
+ *
7
+ * Each function takes {@link SqliteWasmDep} and returns the wasm export itself,
8
+ * typed with branded pointers and raw result codes, so a call costs no
9
+ * JavaScript wrapper. A variadic function whose options need different shims
10
+ * returns a function that passes each option to its shim, as SQLite's
11
+ * JavaScript does. Bind once per database, never per row. Strings are C string
12
+ * pointers; nothing allocates implicitly. A callback parameter takes a function
13
+ * pointer, such as one {@link installWasmFunctions} returns.
14
+ *
15
+ * Each function's documentation gives its wasm type and its signature in the
16
+ * syntax of SQLite's table, where `funcptr:` and the callback's signature stand
17
+ * for a callback argument.
18
+ *
19
+ * Generated by `scripts/generate.mts` from SQLite's own signature table in
20
+ * `scripts/upstream/sqlite3-api-glue.c-pp.js` and the metadata in
21
+ * `scripts/bindings.mts`, with every wasm type checked against the binary's
22
+ * pinned exports. Do not edit.
23
+ *
24
+ * @module
25
+ */
26
+ import { SQLITE_CONFIG_COVERING_INDEX_SCAN, SQLITE_CONFIG_LOOKASIDE, SQLITE_CONFIG_MEMDB_MAXSIZE, SQLITE_CONFIG_MEMSTATUS, SQLITE_CONFIG_SMALL_MALLOC, SQLITE_CONFIG_SORTERREF_SIZE, SQLITE_CONFIG_STMTJRNL_SPILL, SQLITE_CONFIG_URI, SQLITE_DBCONFIG_DEFENSIVE, SQLITE_DBCONFIG_DQS_DDL, SQLITE_DBCONFIG_DQS_DML, SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE, SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE, SQLITE_DBCONFIG_ENABLE_COMMENTS, SQLITE_DBCONFIG_ENABLE_FKEY, SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION, SQLITE_DBCONFIG_ENABLE_QPSG, SQLITE_DBCONFIG_ENABLE_TRIGGER, SQLITE_DBCONFIG_ENABLE_VIEW, SQLITE_DBCONFIG_FP_DIGITS, SQLITE_DBCONFIG_LEGACY_ALTER_TABLE, SQLITE_DBCONFIG_LEGACY_FILE_FORMAT, SQLITE_DBCONFIG_LOOKASIDE, SQLITE_DBCONFIG_MAINDBNAME, SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE, SQLITE_DBCONFIG_RESET_DATABASE, SQLITE_DBCONFIG_REVERSE_SCANORDER, SQLITE_DBCONFIG_STMT_SCANSTATUS, SQLITE_DBCONFIG_TRIGGER_EQP, SQLITE_DBCONFIG_TRUSTED_SCHEMA, SQLITE_DBCONFIG_WRITABLE_SCHEMA, SQLITE_MISUSE, SQLITE_NOTFOUND, } from "./Constants.js";
27
+ /**
28
+ * Initializes the library, returning SQLITE_OK or an error code. Once the
29
+ * library is initialized, further calls are harmless no-ops until
30
+ * {@link sqlite3_shutdown}.
31
+ *
32
+ * Wasm type `i()`. Signature `["sqlite3_initialize", undefined]` from SQLite's
33
+ * table, with the result corrected: SQLite's table declares no result, but the
34
+ * C function returns a result code, as the wasm type shows.
35
+ *
36
+ * See https://sqlite.org/c3ref/initialize.html.
37
+ */
38
+ export const sqlite3_initialize = (deps) => deps.sqliteWasm.exports.sqlite3_initialize;
39
+ /**
40
+ * Deallocates the resources {@link sqlite3_initialize} allocated. Every
41
+ * connection must be closed and every other SQLite resource freed first; only
42
+ * the first call after an initialization has an effect. Then initialize the
43
+ * library again with initializeSqliteWasm. sqlite3_initialize alone, or any
44
+ * call that initializes the library itself, such as an open, makes the unix VFS
45
+ * the default again, from which the generator of {@link sqlite3_randomness},
46
+ * when reset or unused since loading, seeds itself with the time and a constant
47
+ * pid instead of RandomBytes, and registers kvvfs again, which traps when
48
+ * :localStorage: is opened.
49
+ *
50
+ * Wasm type `i()`. Signature `["sqlite3_shutdown", undefined]` from SQLite's
51
+ * table, with the result corrected: SQLite's table declares no result, but the
52
+ * C function returns a result code, as the wasm type shows.
53
+ *
54
+ * See https://sqlite.org/c3ref/initialize.html.
55
+ */
56
+ export const sqlite3_shutdown = (deps) => deps.sqliteWasm.exports.sqlite3_shutdown;
57
+ /**
58
+ * Returns the library's version string, the SQLITE_VERSION it was built with,
59
+ * in static memory.
60
+ *
61
+ * Wasm type `i()`. Signature `["sqlite3_libversion", "string"]` from SQLite's
62
+ * table.
63
+ *
64
+ * See https://sqlite.org/c3ref/libversion.html.
65
+ */
66
+ export const sqlite3_libversion = (deps) => deps.sqliteWasm.exports.sqlite3_libversion;
67
+ /**
68
+ * Returns the SQLITE_VERSION_NUMBER the library was built with.
69
+ *
70
+ * Wasm type `i()`. Signature `["sqlite3_libversion_number", "int"]` from
71
+ * SQLite's table.
72
+ *
73
+ * See https://sqlite.org/c3ref/libversion.html.
74
+ */
75
+ export const sqlite3_libversion_number = (deps) => deps.sqliteWasm.exports.sqlite3_libversion_number;
76
+ /**
77
+ * Returns the date, time and check-in hash of the SQLite source the library was
78
+ * built from, as a static string.
79
+ *
80
+ * Wasm type `i()`. Signature `["sqlite3_sourceid", "string"]` from SQLite's
81
+ * table.
82
+ *
83
+ * See https://sqlite.org/c3ref/libversion.html.
84
+ */
85
+ export const sqlite3_sourceid = (deps) => deps.sqliteWasm.exports.sqlite3_sourceid;
86
+ /**
87
+ * Returns the N-th option defined at compile time, without its SQLITE_ prefix,
88
+ * or NULL when N is out of range. The string is static.
89
+ *
90
+ * Wasm type `i(i)`. Signature `["sqlite3_compileoption_get", "string", "int"]`
91
+ * from SQLite's table.
92
+ *
93
+ * See https://sqlite.org/c3ref/compileoption_get.html.
94
+ */
95
+ export const sqlite3_compileoption_get = (deps) => deps.sqliteWasm.exports.sqlite3_compileoption_get;
96
+ /**
97
+ * Returns 1 if the named option, with or without its SQLITE_ prefix, was
98
+ * defined at compile time, and 0 otherwise.
99
+ *
100
+ * Wasm type `i(i)`. Signature `["sqlite3_compileoption_used", "int", "string"]`
101
+ * from SQLite's table.
102
+ *
103
+ * See https://sqlite.org/c3ref/compileoption_get.html.
104
+ */
105
+ export const sqlite3_compileoption_used = (deps) => deps.sqliteWasm.exports.sqlite3_compileoption_used;
106
+ /**
107
+ * Reads a global SQLITE_STATUS_* counter into `*pCurrent` and its highwater
108
+ * mark into `*pHighwater`, resetting the mark when resetFlag is non-zero. A
109
+ * counter that tracks only one of the two leaves the other unwritten, and
110
+ * values beyond 32 bits are undefined.
111
+ *
112
+ * Wasm type `i(iiii)`. Signature `["sqlite3_status", "int", "int", "*", "*",
113
+ * "int"]` from SQLite's table.
114
+ *
115
+ * See https://sqlite.org/c3ref/status.html.
116
+ */
117
+ export const sqlite3_status = (deps) => deps.sqliteWasm.exports.sqlite3_status;
118
+ /**
119
+ * Reads a global SQLITE_STATUS_* counter into the sqlite3_int64 at pCurrent and
120
+ * its highwater mark into the sqlite3_int64 at pHighwater, 8 bytes each,
121
+ * resetting the mark when resetFlag is non-zero. Some counters leave one of the
122
+ * two outputs unwritten.
123
+ *
124
+ * Wasm type `i(iiii)`. Signature `["sqlite3_status64", "int", "int", "*", "*",
125
+ * "int"]` from SQLite's table.
126
+ *
127
+ * See https://sqlite.org/c3ref/status.html.
128
+ */
129
+ export const sqlite3_status64 = (deps) => deps.sqliteWasm.exports.sqlite3_status64;
130
+ /**
131
+ * Registers an entry point that SQLite calls for every new connection, where an
132
+ * error it returns fails the open; registering one twice is a no-op. Despite
133
+ * the `void (*)(void)` prototype SQLite calls it as `int xEntryPoint(sqlite3
134
+ * *db, char **pzErrMsg, const sqlite3_api_routines *pThunk)`, so its function
135
+ * table entry must have that type.
136
+ *
137
+ * Wasm type `i(i)`. Signature `["sqlite3_auto_extension", "int",
138
+ * "funcptr:i(ppp)"]` from Evolu's supplement: SQLite binds the auto-extension
139
+ * functions by hand to manage the JavaScript functions it converts.
140
+ *
141
+ * See https://sqlite.org/c3ref/auto_extension.html.
142
+ */
143
+ export const sqlite3_auto_extension = (deps) => deps.sqliteWasm.exports.sqlite3_auto_extension;
144
+ /**
145
+ * Unregisters an entry point {@link sqlite3_auto_extension} registered,
146
+ * returning 1 when it was registered and 0 otherwise.
147
+ *
148
+ * Wasm type `i(i)`. Signature `["sqlite3_cancel_auto_extension", "int",
149
+ * "funcptr:i(ppp)"]` from Evolu's supplement: SQLite binds the auto-extension
150
+ * functions by hand to manage the JavaScript functions it converts.
151
+ *
152
+ * See https://sqlite.org/c3ref/cancel_auto_extension.html.
153
+ */
154
+ export const sqlite3_cancel_auto_extension = (deps) => deps.sqliteWasm.exports.sqlite3_cancel_auto_extension;
155
+ /**
156
+ * Unregisters every entry point {@link sqlite3_auto_extension} registered.
157
+ *
158
+ * Wasm type `v()`. Signature `["sqlite3_reset_auto_extension", undefined]` from
159
+ * Evolu's supplement: SQLite binds the auto-extension functions by hand to
160
+ * manage the JavaScript functions it converts.
161
+ *
162
+ * See https://sqlite.org/c3ref/reset_auto_extension.html.
163
+ */
164
+ export const sqlite3_reset_auto_extension = (deps) => deps.sqliteWasm.exports.sqlite3_reset_auto_extension;
165
+ /**
166
+ * Writes N pseudo-random bytes to P. A call with N below 1 or a NULL P writes
167
+ * nothing and makes the next call reseed from the default VFS's xRandomness.
168
+ *
169
+ * Wasm type `v(ii)`. Signature `["sqlite3_randomness", undefined, "int", "*"]`
170
+ * from Evolu's supplement: SQLite binds it by hand to fill typed arrays.
171
+ *
172
+ * See https://sqlite.org/c3ref/randomness.html.
173
+ */
174
+ export const sqlite3_randomness = (deps) => deps.sqliteWasm.exports.sqlite3_randomness;
175
+ /**
176
+ * Returns 1 when UTF-8 SQL text ends with a complete statement, a final
177
+ * semicolon token that does not end inside a CREATE TRIGGER body, and 0
178
+ * otherwise. It tokenizes without parsing, so it does not detect invalid SQL.
179
+ *
180
+ * Wasm type `i(i)`. Signature `["sqlite3_complete", "int", "string:flexible"]`
181
+ * from SQLite's table.
182
+ *
183
+ * See https://sqlite.org/c3ref/complete.html.
184
+ */
185
+ export const sqlite3_complete = (deps) => deps.sqliteWasm.exports.sqlite3_complete;
186
+ /**
187
+ * Returns the number of distinct SQL keywords the library recognizes, which
188
+ * depends on compile-time options.
189
+ *
190
+ * Wasm type `i()`. Signature `["sqlite3_keyword_count", "int"]` from SQLite's
191
+ * table.
192
+ *
193
+ * See https://sqlite.org/c3ref/keyword_check.html.
194
+ */
195
+ export const sqlite3_keyword_count = (deps) => deps.sqliteWasm.exports.sqlite3_keyword_count;
196
+ /**
197
+ * Writes the address and byte length of the 0-based index-th SQL keyword, UTF-8
198
+ * without a NUL terminator in static memory, and returns SQLITE_ERROR when the
199
+ * index is out of range. Both output pointers must be valid.
200
+ *
201
+ * Wasm type `i(iii)`. Signature `["sqlite3_keyword_name", "int", "int", "**",
202
+ * "*"]` from SQLite's table.
203
+ *
204
+ * See https://sqlite.org/c3ref/keyword_check.html.
205
+ */
206
+ export const sqlite3_keyword_name = (deps) => deps.sqliteWasm.exports.sqlite3_keyword_name;
207
+ /**
208
+ * Returns non-zero if the nName bytes of UTF-8 at zName, which need no NUL
209
+ * terminator, are an SQL keyword in any letter case, and 0 otherwise.
210
+ *
211
+ * Wasm type `i(ii)`. Signature `["sqlite3_keyword_check", "int", "string",
212
+ * "int"]` from SQLite's table.
213
+ *
214
+ * See https://sqlite.org/c3ref/keyword_check.html.
215
+ */
216
+ export const sqlite3_keyword_check = (deps) => deps.sqliteWasm.exports.sqlite3_keyword_check;
217
+ /**
218
+ * Returns 0 when zStr matches the GLOB pattern zGlob, case-sensitively as SQL's
219
+ * GLOB operator does, and non-zero otherwise.
220
+ *
221
+ * Wasm type `i(ii)`. Signature `["sqlite3_strglob", "int", "string", "string"]`
222
+ * from SQLite's table.
223
+ *
224
+ * See https://sqlite.org/c3ref/strglob.html.
225
+ */
226
+ export const sqlite3_strglob = (deps) => deps.sqliteWasm.exports.sqlite3_strglob;
227
+ /**
228
+ * Returns 0 when zStr matches the LIKE pattern zGlob with escape character
229
+ * cEsc, or none for 0, and non-zero otherwise. Like SQL's LIKE operator, it
230
+ * folds only ASCII case.
231
+ *
232
+ * Wasm type `i(iii)`. Signature `["sqlite3_strlike", "int", "string", "string",
233
+ * "int"]` from SQLite's table.
234
+ *
235
+ * See https://sqlite.org/c3ref/strlike.html.
236
+ */
237
+ export const sqlite3_strlike = (deps) => deps.sqliteWasm.exports.sqlite3_strlike;
238
+ /**
239
+ * Compares two UTF-8 strings, folding only ASCII case as SQLite does for
240
+ * identifiers, and returns 0 when they are equal or a negative or positive
241
+ * number that orders them.
242
+ *
243
+ * Wasm type `i(ii)`. Signature `["sqlite3_stricmp", "int", "string", "string"]`
244
+ * from SQLite's table.
245
+ *
246
+ * See https://sqlite.org/c3ref/stricmp.html.
247
+ */
248
+ export const sqlite3_stricmp = (deps) => deps.sqliteWasm.exports.sqlite3_stricmp;
249
+ /**
250
+ * Compares at most N bytes of two UTF-8 strings, folding only ASCII case as
251
+ * SQLite does for identifiers, and returns 0 when they are equal or a negative
252
+ * or positive number that orders them.
253
+ *
254
+ * Wasm type `i(iii)`. Signature `["sqlite3_strnicmp", "int", "string",
255
+ * "string", "int"]` from SQLite's table.
256
+ *
257
+ * See https://sqlite.org/c3ref/stricmp.html.
258
+ */
259
+ export const sqlite3_strnicmp = (deps) => deps.sqliteWasm.exports.sqlite3_strnicmp;
260
+ /**
261
+ * Allocates at least byteLength bytes, returning NULL when out of memory or
262
+ * when byteLength is zero or negative.
263
+ *
264
+ * Wasm type `i(i)`. Signature `["sqlite3_malloc", "*", "int"]` from SQLite's
265
+ * table.
266
+ *
267
+ * See https://sqlite.org/c3ref/free.html.
268
+ */
269
+ export const sqlite3_malloc = (deps) => deps.sqliteWasm.exports.sqlite3_malloc;
270
+ /**
271
+ * Allocates memory like {@link sqlite3_malloc} with a 64-bit size, returning
272
+ * NULL when out of memory or for zero bytes.
273
+ *
274
+ * Wasm type `i(j)`. Signature `["sqlite3_malloc64", "*", "i64"]` from SQLite's
275
+ * table.
276
+ *
277
+ * See https://sqlite.org/c3ref/free.html.
278
+ */
279
+ export const sqlite3_malloc64 = (deps) => deps.sqliteWasm.exports.sqlite3_malloc64;
280
+ /**
281
+ * Resizes memory from {@link sqlite3_malloc}, keeping its leading bytes, and
282
+ * returns the new address, after which the old one is invalid. A NULL pointer
283
+ * allocates, a size of 0 or less frees and returns NULL, and when out of memory
284
+ * it returns NULL and leaves the old allocation intact.
285
+ *
286
+ * Wasm type `i(ii)`. Signature `["sqlite3_realloc", "*", "*", "int"]` from
287
+ * SQLite's table.
288
+ *
289
+ * See https://sqlite.org/c3ref/free.html.
290
+ */
291
+ export const sqlite3_realloc = (deps) => deps.sqliteWasm.exports.sqlite3_realloc;
292
+ /**
293
+ * Resizes memory from {@link sqlite3_malloc}, moving its contents to the
294
+ * returned address; NULL memory allocates, and a zero size frees it and returns
295
+ * NULL. When out of memory it returns NULL and leaves the old memory
296
+ * allocated.
297
+ *
298
+ * Wasm type `i(ij)`. Signature `["sqlite3_realloc64", "*", "*", "i64"]` from
299
+ * SQLite's table.
300
+ *
301
+ * See https://sqlite.org/c3ref/free.html.
302
+ */
303
+ export const sqlite3_realloc64 = (deps) => deps.sqliteWasm.exports.sqlite3_realloc64;
304
+ /**
305
+ * Returns the usable byte size of memory from {@link sqlite3_malloc},
306
+ * {@link sqlite3_realloc} or their 64-bit variants, which can exceed the
307
+ * requested size, or 0 for NULL.
308
+ *
309
+ * Wasm type `j(i)`. Signature `["sqlite3_msize", "i64", "*"]` from SQLite's
310
+ * table.
311
+ *
312
+ * See https://sqlite.org/c3ref/free.html.
313
+ */
314
+ export const sqlite3_msize = (deps) => deps.sqliteWasm.exports.sqlite3_msize;
315
+ /**
316
+ * Frees memory from {@link sqlite3_malloc} or from a SQLite function that
317
+ * returns owned memory.
318
+ *
319
+ * Wasm type `v(i)`. Signature `["sqlite3_free", undefined, "*"]` from SQLite's
320
+ * table.
321
+ *
322
+ * See https://sqlite.org/c3ref/free.html.
323
+ */
324
+ export const sqlite3_free = (deps) => deps.sqliteWasm.exports.sqlite3_free;
325
+ /**
326
+ * Opens a database connection for reading and writing, creating the database
327
+ * when it does not exist, with the default VFS. SQLite writes a handle even
328
+ * when opening fails, except when out of memory, and that handle must be
329
+ * closed.
330
+ *
331
+ * Wasm type `i(ii)`. Signature `["sqlite3_open", "int", "string", "*"]` from
332
+ * SQLite's table.
333
+ *
334
+ * See https://sqlite.org/c3ref/open.html.
335
+ */
336
+ export const sqlite3_open = (deps) => deps.sqliteWasm.exports.sqlite3_open;
337
+ /**
338
+ * Opens a database connection. SQLite writes a handle even when opening fails,
339
+ * except when out of memory, and that handle must be closed.
340
+ *
341
+ * Wasm type `i(iiii)`. Signature `["sqlite3_open_v2", "int", "string", "*",
342
+ * "int", "string"]` from SQLite's table.
343
+ *
344
+ * See https://sqlite.org/c3ref/open.html.
345
+ */
346
+ export const sqlite3_open_v2 = (deps) => deps.sqliteWasm.exports.sqlite3_open_v2;
347
+ /**
348
+ * Closes a connection. With unfinalized statements the close is deferred and
349
+ * the connection keeps its files open.
350
+ *
351
+ * Wasm type `i(i)`. Signature `["sqlite3_close_v2", "int", "sqlite3*"]` from
352
+ * Evolu's supplement: SQLite binds it by hand to release JavaScript callbacks
353
+ * first.
354
+ *
355
+ * See https://sqlite.org/c3ref/close.html.
356
+ */
357
+ export const sqlite3_close_v2 = (deps) => deps.sqliteWasm.exports.sqlite3_close_v2;
358
+ /**
359
+ * Returns the absolute filename of a schema of the connection, valid until the
360
+ * schema is detached or the connection closes, or NULL or an empty string for a
361
+ * temporary or in-memory database or an unknown schema. A non-NULL result can
362
+ * be passed to the `sqlite3_uri_*` functions.
363
+ *
364
+ * Wasm type `i(ii)`. Signature `["sqlite3_db_filename", "string", "sqlite3*",
365
+ * "string"]` from SQLite's table.
366
+ *
367
+ * See https://sqlite.org/c3ref/db_filename.html.
368
+ */
369
+ export const sqlite3_db_filename = (deps) => deps.sqliteWasm.exports.sqlite3_db_filename;
370
+ /**
371
+ * Returns the schema name of the connection's N-th database, where 0 is main
372
+ * and 1 is temp, or NULL when N is out of range. SQLite owns the string, which
373
+ * any schema change, such as ATTACH, DETACH, {@link sqlite3_serialize} or
374
+ * {@link sqlite3_deserialize}, can free.
375
+ *
376
+ * Wasm type `i(ii)`. Signature `["sqlite3_db_name", "string", "sqlite3*",
377
+ * "int"]` from SQLite's table.
378
+ *
379
+ * See https://sqlite.org/c3ref/db_name.html.
380
+ */
381
+ export const sqlite3_db_name = (deps) => deps.sqliteWasm.exports.sqlite3_db_name;
382
+ /**
383
+ * Returns 1 if a schema of the connection is read-only, 0 if it is read/write,
384
+ * or -1 when no schema has that name.
385
+ *
386
+ * Wasm type `i(ii)`. Signature `["sqlite3_db_readonly", "int", "sqlite3*",
387
+ * "string"]` from SQLite's table.
388
+ *
389
+ * See https://sqlite.org/c3ref/db_readonly.html.
390
+ */
391
+ export const sqlite3_db_readonly = (deps) => deps.sqliteWasm.exports.sqlite3_db_readonly;
392
+ /**
393
+ * Returns a schema's transaction state, SQLITE_TXN_NONE, SQLITE_TXN_READ or
394
+ * SQLITE_TXN_WRITE, the highest across all schemas for NULL, or -1 for an
395
+ * unknown schema.
396
+ *
397
+ * Wasm type `i(ii)`. Signature `["sqlite3_txn_state", "int", "sqlite3*",
398
+ * "string"]` from SQLite's table.
399
+ *
400
+ * See https://sqlite.org/c3ref/txn_state.html.
401
+ */
402
+ export const sqlite3_txn_state = (deps) => deps.sqliteWasm.exports.sqlite3_txn_state;
403
+ /**
404
+ * Returns 0 from BEGIN until the COMMIT or ROLLBACK that ends the transaction,
405
+ * and non-zero otherwise. It is the only way to tell whether SQLite rolled back
406
+ * a transaction automatically after an error such as SQLITE_FULL or
407
+ * SQLITE_BUSY.
408
+ *
409
+ * Wasm type `i(i)`. Signature `["sqlite3_get_autocommit", "int", "sqlite3*"]`
410
+ * from SQLite's table.
411
+ *
412
+ * See https://sqlite.org/c3ref/get_autocommit.html.
413
+ */
414
+ export const sqlite3_get_autocommit = (deps) => deps.sqliteWasm.exports.sqlite3_get_autocommit;
415
+ /**
416
+ * Sets a run-time limit of the connection and returns its prior value; a
417
+ * negative newVal only reads it, and a value above the compile-time maximum is
418
+ * lowered to that maximum.
419
+ *
420
+ * Wasm type `i(iii)`. Signature `["sqlite3_limit", "int", "sqlite3*", "int",
421
+ * "int"]` from SQLite's table.
422
+ *
423
+ * See https://sqlite.org/c3ref/limit.html.
424
+ */
425
+ export const sqlite3_limit = (deps) => deps.sqliteWasm.exports.sqlite3_limit;
426
+ /**
427
+ * Sets the connection's only busy handler, replacing any other, including the
428
+ * one {@link sqlite3_busy_timeout} sets, or removes it for NULL so a lock fails
429
+ * with SQLITE_BUSY at once. SQLite calls it with pArg and the number of earlier
430
+ * calls for the same lock and retries while it returns non-zero; it must not
431
+ * modify the connection.
432
+ *
433
+ * Wasm type `i(iii)`. Signature `["sqlite3_busy_handler", "int", "sqlite3*",
434
+ * "funcptr:i(pi)", "*"]` from SQLite's table.
435
+ *
436
+ * See https://sqlite.org/c3ref/busy_handler.html.
437
+ */
438
+ export const sqlite3_busy_handler = (deps) => deps.sqliteWasm.exports.sqlite3_busy_handler;
439
+ /**
440
+ * Sets a busy handler that sleeps and retries until at least ms milliseconds
441
+ * have passed, replacing any other busy handler; ms of zero or less removes all
442
+ * busy handlers.
443
+ *
444
+ * Wasm type `i(ii)`. Signature `["sqlite3_busy_timeout", "int", "sqlite3*",
445
+ * "int"]` from SQLite's table.
446
+ *
447
+ * See https://sqlite.org/c3ref/busy_timeout.html.
448
+ */
449
+ export const sqlite3_busy_timeout = (deps) => deps.sqliteWasm.exports.sqlite3_busy_timeout;
450
+ /**
451
+ * Stops the connection's running statements, and statements started before they
452
+ * all finish, at their earliest opportunity with SQLITE_INTERRUPT; an
453
+ * interrupted write in an explicit transaction rolls the transaction back. With
454
+ * no running statement it does nothing.
455
+ *
456
+ * Wasm type `v(i)`. Signature `["sqlite3_interrupt", undefined, "sqlite3*"]`
457
+ * from SQLite's table.
458
+ *
459
+ * See https://sqlite.org/c3ref/interrupt.html.
460
+ */
461
+ export const sqlite3_interrupt = (deps) => deps.sqliteWasm.exports.sqlite3_interrupt;
462
+ /**
463
+ * Returns 1 while an {@link sqlite3_interrupt} is in effect for the connection,
464
+ * and 0 otherwise.
465
+ *
466
+ * Wasm type `i(i)`. Signature `["sqlite3_is_interrupted", "int", "sqlite3*"]`
467
+ * from SQLite's table.
468
+ *
469
+ * See https://sqlite.org/c3ref/interrupt.html.
470
+ */
471
+ export const sqlite3_is_interrupted = (deps) => deps.sqliteWasm.exports.sqlite3_is_interrupted;
472
+ /**
473
+ * Enables extended result codes for the connection when onoff is non-zero and
474
+ * disables them otherwise. They are disabled by default, and
475
+ * {@link sqlite3_extended_errcode} returns them regardless.
476
+ *
477
+ * Wasm type `i(ii)`. Signature `["sqlite3_extended_result_codes", "int",
478
+ * "sqlite3*", "int"]` from SQLite's table.
479
+ *
480
+ * See https://sqlite.org/c3ref/extended_result_codes.html.
481
+ */
482
+ export const sqlite3_extended_result_codes = (deps) => deps.sqliteWasm.exports.sqlite3_extended_result_codes;
483
+ /**
484
+ * Calls the xFileControl method of a schema's file, main for a NULL zDbName,
485
+ * with an opcode and its argument and returns its result; the core handles a
486
+ * few opcodes, such as SQLITE_FCNTL_FILE_POINTER, itself. An unknown schema
487
+ * returns SQLITE_ERROR without recording it for {@link sqlite3_errcode}.
488
+ *
489
+ * Wasm type `i(iiii)`. Signature `["sqlite3_file_control", "int", "sqlite3*",
490
+ * "string", "int", "*"]` from SQLite's table.
491
+ *
492
+ * See https://sqlite.org/c3ref/file_control.html.
493
+ */
494
+ export const sqlite3_file_control = (deps) => deps.sqliteWasm.exports.sqlite3_file_control;
495
+ /**
496
+ * Writes a table column's declared type, collation sequence and NOT NULL,
497
+ * PRIMARY KEY and AUTOINCREMENT flags through the non-NULL output pointers,
498
+ * failing for a missing column or a view; a NULL column name only checks that
499
+ * the table exists. The returned strings stay valid only until the next SQLite
500
+ * call.
501
+ *
502
+ * Wasm type `i(iiiiiiiii)`. Signature `["sqlite3_table_column_metadata", "int",
503
+ * "sqlite3*", "string", "string", "string", "**", "**", "*", "*", "*"]` from
504
+ * SQLite's table.
505
+ *
506
+ * See https://sqlite.org/c3ref/table_column_metadata.html.
507
+ */
508
+ export const sqlite3_table_column_metadata = (deps) => deps.sqliteWasm.exports.sqlite3_table_column_metadata;
509
+ /**
510
+ * Writes the current and highest values of a connection status counter to pCur
511
+ * and pHiwtr, resetting the highest to the current value when resetFlg is
512
+ * non-zero. Values above the int range are truncated;
513
+ * {@link sqlite3_db_status64} returns them in full.
514
+ *
515
+ * Wasm type `i(iiiii)`. Signature `["sqlite3_db_status", "int", "sqlite3*",
516
+ * "int", "*", "*", "int"]` from SQLite's table.
517
+ *
518
+ * See https://sqlite.org/c3ref/db_status.html.
519
+ */
520
+ export const sqlite3_db_status = (deps) => deps.sqliteWasm.exports.sqlite3_db_status;
521
+ /**
522
+ * Reads a connection's SQLITE_DBSTATUS_* counter into the sqlite3_int64 at pCur
523
+ * and its highwater mark into the sqlite3_int64 at pHiwtr, 8 bytes each,
524
+ * resetting the mark to the current value when resetFlg is non-zero.
525
+ *
526
+ * Wasm type `i(iiiii)`. Signature `["sqlite3_db_status64", "int", "sqlite3*",
527
+ * "int", "*", "*", "int"]` from SQLite's table.
528
+ *
529
+ * See https://sqlite.org/c3ref/db_status.html.
530
+ */
531
+ export const sqlite3_db_status64 = (deps) => deps.sqliteWasm.exports.sqlite3_db_status64;
532
+ /**
533
+ * Returns the rowid of the connection's most recent successful INSERT into a
534
+ * rowid table, or 0 if there was none. Inside a trigger it returns the
535
+ * trigger's insert until the trigger ends, and a failed INSERT leaves it
536
+ * unchanged.
537
+ *
538
+ * Wasm type `j(i)`. Signature `["sqlite3_last_insert_rowid", "i64",
539
+ * "sqlite3*"]` from SQLite's table.
540
+ *
541
+ * See https://sqlite.org/c3ref/last_insert_rowid.html.
542
+ */
543
+ export const sqlite3_last_insert_rowid = (deps) => deps.sqliteWasm.exports.sqlite3_last_insert_rowid;
544
+ /**
545
+ * Sets the value {@link sqlite3_last_insert_rowid} returns for the connection
546
+ * without inserting a row.
547
+ *
548
+ * Wasm type `v(ij)`. Signature `["sqlite3_set_last_insert_rowid", undefined,
549
+ * "sqlite3*", "i64"]` from SQLite's table.
550
+ *
551
+ * See https://sqlite.org/c3ref/set_last_insert_rowid.html.
552
+ */
553
+ export const sqlite3_set_last_insert_rowid = (deps) => deps.sqliteWasm.exports.sqlite3_set_last_insert_rowid;
554
+ /**
555
+ * Returns the rows changed by the connection's most recently completed INSERT,
556
+ * UPDATE or DELETE, without changes by triggers, foreign key actions or
557
+ * REPLACE; other statements leave it unchanged, except a DROP TABLE that, with
558
+ * foreign keys on, first deletes the rows of a table that foreign keys
559
+ * reference. The result is undefined above the int range, which
560
+ * {@link sqlite3_changes64} covers.
561
+ *
562
+ * Wasm type `i(i)`. Signature `["sqlite3_changes", "int", "sqlite3*"]` from
563
+ * SQLite's table.
564
+ *
565
+ * See https://sqlite.org/c3ref/changes.html.
566
+ */
567
+ export const sqlite3_changes = (deps) => deps.sqliteWasm.exports.sqlite3_changes;
568
+ /**
569
+ * Returns the rows changed by the connection's most recently completed INSERT,
570
+ * UPDATE or DELETE, without changes by triggers, foreign key actions or
571
+ * REPLACE; other statements leave it unchanged, except a DROP TABLE that, with
572
+ * foreign keys on, first deletes the rows of a table that foreign keys
573
+ * reference.
574
+ *
575
+ * Wasm type `j(i)`. Signature `["sqlite3_changes64", "i64", "sqlite3*"]` from
576
+ * SQLite's table.
577
+ *
578
+ * See https://sqlite.org/c3ref/changes.html.
579
+ */
580
+ export const sqlite3_changes64 = (deps) => deps.sqliteWasm.exports.sqlite3_changes64;
581
+ /**
582
+ * Returns the rows inserted, updated or deleted by the connection's completed
583
+ * statements since it opened, including those of triggers and foreign key
584
+ * actions. The result is undefined beyond the int range, which
585
+ * {@link sqlite3_total_changes64} avoids.
586
+ *
587
+ * Wasm type `i(i)`. Signature `["sqlite3_total_changes", "int", "sqlite3*"]`
588
+ * from SQLite's table.
589
+ *
590
+ * See https://sqlite.org/c3ref/total_changes.html.
591
+ */
592
+ export const sqlite3_total_changes = (deps) => deps.sqliteWasm.exports.sqlite3_total_changes;
593
+ /**
594
+ * Returns the number of rows changed by INSERT, UPDATE and DELETE statements on
595
+ * the connection since it opened, counting trigger and foreign key action
596
+ * changes but not REPLACE conflict deletions. Other connections do not change
597
+ * it, and other statements do not either, except a DROP TABLE that, with
598
+ * foreign keys on, first deletes the rows of a table that foreign keys
599
+ * reference.
600
+ *
601
+ * Wasm type `j(i)`. Signature `["sqlite3_total_changes64", "i64", "sqlite3*"]`
602
+ * from SQLite's table.
603
+ *
604
+ * See https://sqlite.org/c3ref/total_changes.html.
605
+ */
606
+ export const sqlite3_total_changes64 = (deps) => deps.sqliteWasm.exports.sqlite3_total_changes64;
607
+ /**
608
+ * Runs zero or more semicolon-separated UTF-8 SQL statements, stopping at the
609
+ * first error, and calls the callback, unless NULL, with pArg for each result
610
+ * row; a non-zero callback result stops with SQLITE_ABORT. Unless errmsg is
611
+ * NULL, it receives NULL on success or an error message the caller frees with
612
+ * {@link sqlite3_free}.
613
+ *
614
+ * Wasm type `i(iiiii)`. Signature `["sqlite3_exec", "int", "sqlite3*",
615
+ * "string:flexible", "funcptr:i(pipp)", "*", "**"]` from SQLite's table.
616
+ *
617
+ * See https://sqlite.org/c3ref/exec.html.
618
+ */
619
+ export const sqlite3_exec = (deps) => deps.sqliteWasm.exports.sqlite3_exec;
620
+ /**
621
+ * Copies a schema, NULL meaning main, into memory from {@link sqlite3_malloc64}
622
+ * that the caller frees, writing its byte size as an 8-byte sqlite3_int64 to
623
+ * piSize unless NULL. An empty database first gets its first page from an empty
624
+ * write transaction. Pages are read through the pager, so an encrypted database
625
+ * comes out decrypted, and a page that fails to read comes out zero-filled.
626
+ * Returns NULL when out of memory, for an unknown schema or a database without
627
+ * pages, and with SQLITE_SERIALIZE_NOCOPY returns SQLite's own buffer of a
628
+ * deserialized database, or NULL, instead of a copy, which the caller must
629
+ * neither free nor modify. Only a call whose mFlags is 0 returns memory
630
+ * {@link sqlite3_free} accepts.
631
+ *
632
+ * Wasm type `i(iiii)`. Signature `["sqlite3_serialize", "*", "sqlite3*",
633
+ * "string", "*", "int"]` from SQLite's table.
634
+ *
635
+ * See https://sqlite.org/c3ref/serialize.html.
636
+ */
637
+ export const sqlite3_serialize = (deps) => deps.sqliteWasm.exports.sqlite3_serialize;
638
+ /**
639
+ * Reopens a schema, main for NULL, as an in-memory database over the first szDb
640
+ * bytes of a szBuf-byte buffer, which must stay valid and unmodified until the
641
+ * connection closes. With SQLITE_DESERIALIZE_FREEONCLOSE, SQLite takes
642
+ * ownership of the {@link sqlite3_malloc}'d buffer and frees it, even when
643
+ * deserializing fails.
644
+ *
645
+ * Wasm type `i(iiijji)`. Signature `["sqlite3_deserialize", "int", "sqlite3*",
646
+ * "string", "*", "i64", "i64", "int"]` from SQLite's table.
647
+ *
648
+ * See https://sqlite.org/c3ref/deserialize.html.
649
+ */
650
+ export const sqlite3_deserialize = (deps) => deps.sqliteWasm.exports.sqlite3_deserialize;
651
+ /**
652
+ * Returns the result code of the connection's most recent API call if that call
653
+ * failed, as a primary code unless extended result codes are enabled.
654
+ *
655
+ * Wasm type `i(i)`. Signature `["sqlite3_errcode", "int", "sqlite3*"]` from
656
+ * SQLite's table.
657
+ *
658
+ * See https://sqlite.org/c3ref/errcode.html.
659
+ */
660
+ export const sqlite3_errcode = (deps) => deps.sqliteWasm.exports.sqlite3_errcode;
661
+ /**
662
+ * Returns the connection's most recent extended result code.
663
+ *
664
+ * Wasm type `i(i)`. Signature `["sqlite3_extended_errcode", "int", "sqlite3*"]`
665
+ * from SQLite's table.
666
+ *
667
+ * See https://sqlite.org/c3ref/errcode.html.
668
+ */
669
+ export const sqlite3_extended_errcode = (deps) => deps.sqliteWasm.exports.sqlite3_extended_errcode;
670
+ /**
671
+ * Returns the English message of the connection's most recent error, or NULL
672
+ * when none is available. SQLite owns the string, which the next call on the
673
+ * connection can overwrite or free.
674
+ *
675
+ * Wasm type `i(i)`. Signature `["sqlite3_errmsg", "string", "sqlite3*"]` from
676
+ * SQLite's table.
677
+ *
678
+ * See https://sqlite.org/c3ref/errcode.html.
679
+ */
680
+ export const sqlite3_errmsg = (deps) => deps.sqliteWasm.exports.sqlite3_errmsg;
681
+ /**
682
+ * Returns the English description of a result code, or NULL when none is
683
+ * available. The string is static and must not be freed.
684
+ *
685
+ * Wasm type `i(i)`. Signature `["sqlite3_errstr", "string", "int"]` from
686
+ * SQLite's table.
687
+ *
688
+ * See https://sqlite.org/c3ref/errcode.html.
689
+ */
690
+ export const sqlite3_errstr = (deps) => deps.sqliteWasm.exports.sqlite3_errstr;
691
+ /**
692
+ * Returns the byte offset in the SQL of the most recent error, or -1.
693
+ *
694
+ * Wasm type `i(i)`. Signature `["sqlite3_error_offset", "int", "sqlite3*"]`
695
+ * from SQLite's table.
696
+ *
697
+ * See https://sqlite.org/c3ref/errcode.html.
698
+ */
699
+ export const sqlite3_error_offset = (deps) => deps.sqliteWasm.exports.sqlite3_error_offset;
700
+ /**
701
+ * Sets the error code and a copy of zErrMsg, or the code's default message for
702
+ * NULL, that {@link sqlite3_errcode} and {@link sqlite3_errmsg} report for a
703
+ * connection until SQLite or another call replaces them.
704
+ *
705
+ * Wasm type `i(iii)`. Signature `["sqlite3_set_errmsg", "int", "sqlite3*",
706
+ * "int", "string"]` from SQLite's table.
707
+ *
708
+ * See https://sqlite.org/c3ref/set_errmsg.html.
709
+ */
710
+ export const sqlite3_set_errmsg = (deps) => deps.sqliteWasm.exports.sqlite3_set_errmsg;
711
+ /**
712
+ * Sets the connection's commit callback, replacing the previous one, or removes
713
+ * it for NULL, and returns the previous call's pArg, NULL for the first call.
714
+ * SQLite calls it with pArg before each commit and turns the commit into a
715
+ * rollback when it returns non-zero; it must not modify the connection.
716
+ *
717
+ * Wasm type `i(iii)`. Signature `["sqlite3_commit_hook", "void*", "sqlite3*",
718
+ * "funcptr:i(p)", "*"]` from SQLite's table.
719
+ *
720
+ * See https://sqlite.org/c3ref/commit_hook.html.
721
+ */
722
+ export const sqlite3_commit_hook = (deps) => deps.sqliteWasm.exports.sqlite3_commit_hook;
723
+ /**
724
+ * Registers the callback SQLite calls with pArg whenever a transaction rolls
725
+ * back, except when closing the connection, replacing the previous one; NULL
726
+ * removes it. Returns the previous pArg or NULL; the callback must not use the
727
+ * connection, not even to prepare or step a statement.
728
+ *
729
+ * Wasm type `i(iii)`. Signature `["sqlite3_rollback_hook", "void*", "sqlite3*",
730
+ * "funcptr:v(p)", "*"]` from SQLite's table.
731
+ *
732
+ * See https://sqlite.org/c3ref/commit_hook.html.
733
+ */
734
+ export const sqlite3_rollback_hook = (deps) => deps.sqliteWasm.exports.sqlite3_rollback_hook;
735
+ /**
736
+ * Registers the connection's callback for each row inserted, updated or deleted
737
+ * in a rowid table, replacing the previous one or removing it for NULL, and
738
+ * returns the previous pArg or NULL. The callback must not modify the
739
+ * connection and does not fire for WITHOUT ROWID tables, REPLACE conflict
740
+ * deletions or the truncate optimization.
741
+ *
742
+ * Wasm type `i(iii)`. Signature `["sqlite3_update_hook", "*", "sqlite3*",
743
+ * "funcptr:v(pippj)", "*"]` from SQLite's table.
744
+ *
745
+ * See https://sqlite.org/c3ref/update_hook.html.
746
+ */
747
+ export const sqlite3_update_hook = (deps) => deps.sqliteWasm.exports.sqlite3_update_hook;
748
+ /**
749
+ * Registers the connection's one trace callback for the SQLITE_TRACE_* events
750
+ * in uMask, replacing any previous one; a NULL callback or a zero mask disables
751
+ * tracing. The callback receives the event code, pCtx and two event-specific
752
+ * pointers, and should return 0.
753
+ *
754
+ * Wasm type `i(iiii)`. Signature `["sqlite3_trace_v2", "int", "sqlite3*",
755
+ * "int", "funcptr:i(ippp)", "*"]` from SQLite's table.
756
+ *
757
+ * See https://sqlite.org/c3ref/trace_v2.html.
758
+ */
759
+ export const sqlite3_trace_v2 = (deps) => deps.sqliteWasm.exports.sqlite3_trace_v2;
760
+ /**
761
+ * Sets the connection's callback for an undefined collation sequence, replacing
762
+ * the previous one. SQLite calls it with pArg, the connection, the preferred
763
+ * text encoding and the UTF-8 collation name, and the callback should register
764
+ * that collation.
765
+ *
766
+ * Wasm type `i(iii)`. Signature `["sqlite3_collation_needed", "int",
767
+ * "sqlite3*", "*", "*"]` from SQLite's table.
768
+ *
769
+ * See https://sqlite.org/c3ref/collation_needed.html.
770
+ */
771
+ export const sqlite3_collation_needed = (deps) => deps.sqliteWasm.exports.sqlite3_collation_needed;
772
+ /**
773
+ * Compiles the first statement of UTF-8 SQL as {@link sqlite3_prepare_v3} does
774
+ * with no flags, reading at most nByte bytes or up to a NUL when nByte is
775
+ * negative, and writes the statement to `*ppStmt` and the address of the
776
+ * uncompiled rest to `*pzTail`. `*ppStmt` is NULL on error and for SQL without
777
+ * a statement, such as only a comment; the caller finalizes a non-NULL one.
778
+ *
779
+ * Wasm type `i(iiiii)`. Signature `["sqlite3_prepare_v2", "int", "sqlite3*",
780
+ * "*", "int", "**", "**"]` from Evolu's supplement: SQLite binds it by hand to
781
+ * accept JavaScript strings.
782
+ *
783
+ * See https://sqlite.org/c3ref/prepare.html.
784
+ */
785
+ export const sqlite3_prepare_v2 = (deps) => deps.sqliteWasm.exports.sqlite3_prepare_v2;
786
+ /**
787
+ * Compiles the first statement of UTF-8 SQL, reading at most nByte bytes or up
788
+ * to a NUL when nByte is negative, and writes the statement to `*ppStmt` and
789
+ * the address of the uncompiled rest to `*pzTail`. `*ppStmt` is NULL on error
790
+ * and for SQL without a statement, such as only a comment; the caller finalizes
791
+ * a non-NULL one.
792
+ *
793
+ * Wasm type `i(iiiiii)`. Signature `["sqlite3_prepare_v3", "int", "sqlite3*",
794
+ * "*", "int", "int", "**", "**"]` from Evolu's supplement: SQLite binds it by
795
+ * hand to accept JavaScript strings.
796
+ *
797
+ * See https://sqlite.org/c3ref/prepare.html.
798
+ */
799
+ export const sqlite3_prepare_v3 = (deps) => deps.sqliteWasm.exports.sqlite3_prepare_v3;
800
+ /**
801
+ * Evaluates a statement one step, returning SQLITE_ROW, SQLITE_DONE or an
802
+ * error.
803
+ *
804
+ * Wasm type `i(i)`. Signature `["sqlite3_step", "int", "sqlite3_stmt*"]` from
805
+ * SQLite's table.
806
+ *
807
+ * See https://sqlite.org/c3ref/step.html.
808
+ */
809
+ export const sqlite3_step = (deps) => deps.sqliteWasm.exports.sqlite3_step;
810
+ /**
811
+ * Resets a statement so it can run again, keeping its bindings. It returns the
812
+ * error of a failed most recent step, and can fail on its own, such as with
813
+ * SQLITE_BUSY when an INSERT with RETURNING stepped only once cannot commit.
814
+ *
815
+ * Wasm type `i(i)`. Signature `["sqlite3_reset", "int", "sqlite3_stmt*"]` from
816
+ * SQLite's table.
817
+ *
818
+ * See https://sqlite.org/c3ref/reset.html.
819
+ */
820
+ export const sqlite3_reset = (deps) => deps.sqliteWasm.exports.sqlite3_reset;
821
+ /**
822
+ * Destroys a prepared statement and returns the error of its most recent
823
+ * evaluation if that failed, otherwise SQLITE_OK; NULL is a harmless no-op.
824
+ *
825
+ * Wasm type `i(i)`. Signature `["sqlite3_finalize", "int", "sqlite3_stmt*"]`
826
+ * from SQLite's table.
827
+ *
828
+ * See https://sqlite.org/c3ref/finalize.html.
829
+ */
830
+ export const sqlite3_finalize = (deps) => deps.sqliteWasm.exports.sqlite3_finalize;
831
+ /**
832
+ * Returns the connection's first prepared statement for a NULL pStmt, otherwise
833
+ * the one after pStmt, or NULL when there is none.
834
+ *
835
+ * Wasm type `i(ii)`. Signature `["sqlite3_next_stmt", "sqlite3_stmt*",
836
+ * "sqlite3*", "sqlite3_stmt*"]` from SQLite's table.
837
+ *
838
+ * See https://sqlite.org/c3ref/next_stmt.html.
839
+ */
840
+ export const sqlite3_next_stmt = (deps) => deps.sqliteWasm.exports.sqlite3_next_stmt;
841
+ /**
842
+ * Returns the connection a prepared statement belongs to.
843
+ *
844
+ * Wasm type `i(i)`. Signature `["sqlite3_db_handle", "sqlite3*",
845
+ * "sqlite3_stmt*"]` from SQLite's table.
846
+ *
847
+ * See https://sqlite.org/c3ref/db_handle.html.
848
+ */
849
+ export const sqlite3_db_handle = (deps) => deps.sqliteWasm.exports.sqlite3_db_handle;
850
+ /**
851
+ * Returns the SQL text a statement was prepared from, which SQLite frees when
852
+ * the statement is finalized, or NULL for a statement from the legacy
853
+ * sqlite3_prepare, which this build does not export.
854
+ *
855
+ * Wasm type `i(i)`. Signature `["sqlite3_sql", "string", "sqlite3_stmt*"]` from
856
+ * SQLite's table.
857
+ *
858
+ * See https://sqlite.org/c3ref/expanded_sql.html.
859
+ */
860
+ export const sqlite3_sql = (deps) => deps.sqliteWasm.exports.sqlite3_sql;
861
+ /**
862
+ * Returns the statement's SQL with bound parameters expanded as literals, in
863
+ * memory the caller frees with {@link sqlite3_free}, or NULL when out of memory,
864
+ * above SQLITE_LIMIT_LENGTH, or when built with SQLITE_OMIT_TRACE.
865
+ *
866
+ * Wasm type `i(i)`. Signature `["sqlite3_expanded_sql", "string",
867
+ * "sqlite3_stmt*"]` from SQLite's table.
868
+ *
869
+ * See https://sqlite.org/c3ref/expanded_sql.html.
870
+ */
871
+ export const sqlite3_expanded_sql = (deps) => deps.sqliteWasm.exports.sqlite3_expanded_sql;
872
+ /**
873
+ * Returns non-zero when a statement has been stepped but has neither returned
874
+ * SQLITE_DONE nor been reset, and 0 for NULL.
875
+ *
876
+ * Wasm type `i(i)`. Signature `["sqlite3_stmt_busy", "int", "sqlite3_stmt*"]`
877
+ * from SQLite's table.
878
+ *
879
+ * See https://sqlite.org/c3ref/stmt_busy.html.
880
+ */
881
+ export const sqlite3_stmt_busy = (deps) => deps.sqliteWasm.exports.sqlite3_stmt_busy;
882
+ /**
883
+ * Returns non-zero when a statement cannot directly change the database file,
884
+ * though application-defined functions or virtual tables it calls still might.
885
+ * Transaction control, ATTACH and DETACH count as read-only; BEGIN IMMEDIATE,
886
+ * BEGIN EXCLUSIVE and any statement that might write do not.
887
+ *
888
+ * Wasm type `i(i)`. Signature `["sqlite3_stmt_readonly", "int",
889
+ * "sqlite3_stmt*"]` from SQLite's table.
890
+ *
891
+ * See https://sqlite.org/c3ref/stmt_readonly.html.
892
+ */
893
+ export const sqlite3_stmt_readonly = (deps) => deps.sqliteWasm.exports.sqlite3_stmt_readonly;
894
+ /**
895
+ * Makes a statement behave as if its SQL began with EXPLAIN (eMode 1), EXPLAIN
896
+ * QUERY PLAN (2) or neither (0), possibly re-preparing it. It fails while the
897
+ * statement is active, so reset it first.
898
+ *
899
+ * Wasm type `i(ii)`. Signature `["sqlite3_stmt_explain", "int",
900
+ * "sqlite3_stmt*", "int"]` from SQLite's table.
901
+ *
902
+ * See https://sqlite.org/c3ref/stmt_explain.html.
903
+ */
904
+ export const sqlite3_stmt_explain = (deps) => deps.sqliteWasm.exports.sqlite3_stmt_explain;
905
+ /**
906
+ * Returns 1 for an EXPLAIN statement, 2 for EXPLAIN QUERY PLAN, and 0 for an
907
+ * ordinary statement or NULL.
908
+ *
909
+ * Wasm type `i(i)`. Signature `["sqlite3_stmt_isexplain", "int",
910
+ * "sqlite3_stmt*"]` from SQLite's table.
911
+ *
912
+ * See https://sqlite.org/c3ref/stmt_isexplain.html.
913
+ */
914
+ export const sqlite3_stmt_isexplain = (deps) => deps.sqliteWasm.exports.sqlite3_stmt_isexplain;
915
+ /**
916
+ * Returns one of a statement's SQLITE_STMTSTATUS_* counters, and resets it to 0
917
+ * afterwards when resetFlg is non-zero.
918
+ *
919
+ * Wasm type `i(iii)`. Signature `["sqlite3_stmt_status", "int",
920
+ * "sqlite3_stmt*", "int", "int"]` from SQLite's table.
921
+ *
922
+ * See https://sqlite.org/c3ref/stmt_status.html.
923
+ */
924
+ export const sqlite3_stmt_status = (deps) => deps.sqliteWasm.exports.sqlite3_stmt_status;
925
+ /**
926
+ * Returns the index of a statement's largest SQL parameter, which is the number
927
+ * of parameters unless `?NNN` parameters leave gaps.
928
+ *
929
+ * Wasm type `i(i)`. Signature `["sqlite3_bind_parameter_count", "int",
930
+ * "sqlite3_stmt*"]` from SQLite's table.
931
+ *
932
+ * See https://sqlite.org/c3ref/bind_parameter_count.html.
933
+ */
934
+ export const sqlite3_bind_parameter_count = (deps) => deps.sqliteWasm.exports.sqlite3_bind_parameter_count;
935
+ /**
936
+ * Returns the 1-based index of the SQL parameter with a UTF-8 name that
937
+ * includes its prefix, such as `:name`, or 0 when no parameter matches.
938
+ *
939
+ * Wasm type `i(ii)`. Signature `["sqlite3_bind_parameter_index", "int",
940
+ * "sqlite3_stmt*", "string"]` from SQLite's table.
941
+ *
942
+ * See https://sqlite.org/c3ref/bind_parameter_index.html.
943
+ */
944
+ export const sqlite3_bind_parameter_index = (deps) => deps.sqliteWasm.exports.sqlite3_bind_parameter_index;
945
+ /**
946
+ * Returns the name of the SQL parameter at a 1-based index, including its
947
+ * prefix as in `:name` or `?NNN`, or NULL for a nameless `?` parameter or an
948
+ * index out of range. The statement owns the string.
949
+ *
950
+ * Wasm type `i(ii)`. Signature `["sqlite3_bind_parameter_name", "string",
951
+ * "sqlite3_stmt*", "int"]` from SQLite's table.
952
+ *
953
+ * See https://sqlite.org/c3ref/bind_parameter_name.html.
954
+ */
955
+ export const sqlite3_bind_parameter_name = (deps) => deps.sqliteWasm.exports.sqlite3_bind_parameter_name;
956
+ /**
957
+ * Binds NULL to a parameter.
958
+ *
959
+ * Wasm type `i(ii)`. Signature `["sqlite3_bind_null", undefined,
960
+ * "sqlite3_stmt*", "int"]` from SQLite's table, with the result corrected:
961
+ * SQLite's table declares no result, but the C function returns a result code,
962
+ * as the wasm type shows.
963
+ *
964
+ * See https://sqlite.org/c3ref/bind_blob.html.
965
+ */
966
+ export const sqlite3_bind_null = (deps) => deps.sqliteWasm.exports.sqlite3_bind_null;
967
+ /**
968
+ * Binds a 32-bit integer to a parameter. The wasm boundary converts the number
969
+ * with ToInt32, so a fraction is truncated and a value outside the int32 range
970
+ * wraps silently.
971
+ *
972
+ * Wasm type `i(iii)`. Signature `["sqlite3_bind_int", "int", "sqlite3_stmt*",
973
+ * "int", "int"]` from SQLite's table.
974
+ *
975
+ * See https://sqlite.org/c3ref/bind_blob.html.
976
+ */
977
+ export const sqlite3_bind_int = (deps) => deps.sqliteWasm.exports.sqlite3_bind_int;
978
+ /**
979
+ * Binds a 64-bit integer to a parameter. The wasm boundary wraps a bigint
980
+ * outside the int64 range silently.
981
+ *
982
+ * Wasm type `i(iij)`. Signature `["sqlite3_bind_int64", "int", "sqlite3_stmt*",
983
+ * "int", "i64"]` from SQLite's table.
984
+ *
985
+ * See https://sqlite.org/c3ref/bind_blob.html.
986
+ */
987
+ export const sqlite3_bind_int64 = (deps) => deps.sqliteWasm.exports.sqlite3_bind_int64;
988
+ /**
989
+ * Binds a double to a parameter; SQLite stores NaN as NULL.
990
+ *
991
+ * Wasm type `i(iid)`. Signature `["sqlite3_bind_double", "int",
992
+ * "sqlite3_stmt*", "int", "f64"]` from SQLite's table.
993
+ *
994
+ * See https://sqlite.org/c3ref/bind_blob.html.
995
+ */
996
+ export const sqlite3_bind_double = (deps) => deps.sqliteWasm.exports.sqlite3_bind_double;
997
+ /**
998
+ * Binds UTF-8 text to a parameter: n bytes, which may include NUL characters,
999
+ * or up to the first NUL when n is negative. A NULL address binds SQL NULL.
1000
+ *
1001
+ * Wasm type `i(iiiii)`. Signature `["sqlite3_bind_text", "int",
1002
+ * "sqlite3_stmt*", "int", "*", "int", "*"]` from Evolu's supplement: SQLite
1003
+ * binds it by hand to accept JavaScript strings and typed arrays.
1004
+ *
1005
+ * See https://sqlite.org/c3ref/bind_blob.html.
1006
+ */
1007
+ export const sqlite3_bind_text = (deps) => deps.sqliteWasm.exports.sqlite3_bind_text;
1008
+ /**
1009
+ * Binds n bytes to a parameter; a negative n is undefined behavior. A NULL
1010
+ * address binds SQL NULL, so an empty blob needs a non-NULL address.
1011
+ *
1012
+ * Wasm type `i(iiiii)`. Signature `["sqlite3_bind_blob", "int",
1013
+ * "sqlite3_stmt*", "int", "*", "int", "*"]` from Evolu's supplement: SQLite
1014
+ * binds it by hand to accept typed arrays.
1015
+ *
1016
+ * See https://sqlite.org/c3ref/bind_blob.html.
1017
+ */
1018
+ export const sqlite3_bind_blob = (deps) => deps.sqliteWasm.exports.sqlite3_bind_blob;
1019
+ /**
1020
+ * Binds a blob of n zero bytes to a parameter without allocating its content; a
1021
+ * negative n binds a zero-length blob.
1022
+ *
1023
+ * Wasm type `i(iii)`. Signature `["sqlite3_bind_zeroblob", "int",
1024
+ * "sqlite3_stmt*", "int", "int"]` from SQLite's table.
1025
+ *
1026
+ * See https://sqlite.org/c3ref/bind_blob.html.
1027
+ */
1028
+ export const sqlite3_bind_zeroblob = (deps) => deps.sqliteWasm.exports.sqlite3_bind_zeroblob;
1029
+ /**
1030
+ * Binds SQL NULL carrying pPtr tagged with the type string zPType, which only
1031
+ * {@link sqlite3_value_pointer} with an equal type string returns. The type
1032
+ * string should be static because SQLite keeps its address, and SQLite calls
1033
+ * xDestructor, unless NULL, with pPtr when done, even when binding fails.
1034
+ *
1035
+ * Wasm type `i(iiiii)`. Signature `["sqlite3_bind_pointer", "int",
1036
+ * "sqlite3_stmt*", "int", "*", "string:static", "*"]` from SQLite's table.
1037
+ *
1038
+ * See https://sqlite.org/c3ref/bind_blob.html.
1039
+ */
1040
+ export const sqlite3_bind_pointer = (deps) => deps.sqliteWasm.exports.sqlite3_bind_pointer;
1041
+ /**
1042
+ * Sets every parameter of a statement to NULL, which {@link sqlite3_reset} does
1043
+ * not do.
1044
+ *
1045
+ * Wasm type `i(i)`. Signature `["sqlite3_clear_bindings", "int",
1046
+ * "sqlite3_stmt*"]` from SQLite's table.
1047
+ *
1048
+ * See https://sqlite.org/c3ref/clear_bindings.html.
1049
+ */
1050
+ export const sqlite3_clear_bindings = (deps) => deps.sqliteWasm.exports.sqlite3_clear_bindings;
1051
+ /**
1052
+ * Returns the number of result columns of a statement.
1053
+ *
1054
+ * Wasm type `i(i)`. Signature `["sqlite3_column_count", "int",
1055
+ * "sqlite3_stmt*"]` from SQLite's table.
1056
+ *
1057
+ * See https://sqlite.org/c3ref/column_count.html.
1058
+ */
1059
+ export const sqlite3_column_count = (deps) => deps.sqliteWasm.exports.sqlite3_column_count;
1060
+ /**
1061
+ * Returns the number of columns in the statement's current row, or 0 when the
1062
+ * last step did not return SQLITE_ROW or the statement is NULL.
1063
+ *
1064
+ * Wasm type `i(i)`. Signature `["sqlite3_data_count", "int", "sqlite3_stmt*"]`
1065
+ * from SQLite's table.
1066
+ *
1067
+ * See https://sqlite.org/c3ref/data_count.html.
1068
+ */
1069
+ export const sqlite3_data_count = (deps) => deps.sqliteWasm.exports.sqlite3_data_count;
1070
+ /**
1071
+ * Returns the name of a result column, which is its AS alias or else
1072
+ * unspecified, or NULL when out of memory or the index is out of range. The
1073
+ * statement owns the string until it is finalized or re-prepared.
1074
+ *
1075
+ * Wasm type `i(ii)`. Signature `["sqlite3_column_name", "string",
1076
+ * "sqlite3_stmt*", "int"]` from SQLite's table.
1077
+ *
1078
+ * See https://sqlite.org/c3ref/column_name.html.
1079
+ */
1080
+ export const sqlite3_column_name = (deps) => deps.sqliteWasm.exports.sqlite3_column_name;
1081
+ /**
1082
+ * Returns the declared type of the table column a result column comes from, or
1083
+ * NULL when the result column is an expression or subquery. The statement owns
1084
+ * the string.
1085
+ *
1086
+ * Wasm type `i(ii)`. Signature `["sqlite3_column_decltype", "string",
1087
+ * "sqlite3_stmt*", "int"]` from SQLite's table.
1088
+ *
1089
+ * See https://sqlite.org/c3ref/column_decltype.html.
1090
+ */
1091
+ export const sqlite3_column_decltype = (deps) => deps.sqliteWasm.exports.sqlite3_column_decltype;
1092
+ /**
1093
+ * Returns the storage class of a result column in the current row. Read it
1094
+ * before any other column function, which can convert the value.
1095
+ *
1096
+ * Wasm type `i(ii)`. Signature `["sqlite3_column_type", "int", "sqlite3_stmt*",
1097
+ * "int"]` from SQLite's table.
1098
+ *
1099
+ * See https://sqlite.org/c3ref/column_blob.html.
1100
+ */
1101
+ export const sqlite3_column_type = (deps) => deps.sqliteWasm.exports.sqlite3_column_type;
1102
+ /**
1103
+ * Returns a result column of the current row as a 32-bit integer, converting
1104
+ * other types; an integer outside the 32-bit range keeps only its low 32 bits.
1105
+ *
1106
+ * Wasm type `i(ii)`. Signature `["sqlite3_column_int", "int", "sqlite3_stmt*",
1107
+ * "int"]` from SQLite's table.
1108
+ *
1109
+ * See https://sqlite.org/c3ref/column_blob.html.
1110
+ */
1111
+ export const sqlite3_column_int = (deps) => deps.sqliteWasm.exports.sqlite3_column_int;
1112
+ /**
1113
+ * Returns a result column of the current row as a 64-bit integer, converting
1114
+ * other types as CAST does, and 0 for NULL.
1115
+ *
1116
+ * Wasm type `j(ii)`. Signature `["sqlite3_column_int64", "i64",
1117
+ * "sqlite3_stmt*", "int"]` from SQLite's table.
1118
+ *
1119
+ * See https://sqlite.org/c3ref/column_blob.html.
1120
+ */
1121
+ export const sqlite3_column_int64 = (deps) => deps.sqliteWasm.exports.sqlite3_column_int64;
1122
+ /**
1123
+ * Returns a result column of the current row as a double, converting other
1124
+ * types, such as NULL to 0.0.
1125
+ *
1126
+ * Wasm type `d(ii)`. Signature `["sqlite3_column_double", "f64",
1127
+ * "sqlite3_stmt*", "int"]` from SQLite's table.
1128
+ *
1129
+ * See https://sqlite.org/c3ref/column_blob.html.
1130
+ */
1131
+ export const sqlite3_column_double = (deps) => deps.sqliteWasm.exports.sqlite3_column_double;
1132
+ /**
1133
+ * Returns the address of a result column as NUL-terminated UTF-8 text that can
1134
+ * contain NUL characters, so read its length with {@link sqlite3_column_bytes}
1135
+ * afterwards. Returns NULL for SQL NULL and when out of memory, which
1136
+ * {@link sqlite3_errcode} tells apart; the text stays valid until the next step,
1137
+ * reset or finalize, or a conversion by another column call.
1138
+ *
1139
+ * Wasm type `i(ii)`. Signature `["sqlite3_column_text", "*", "sqlite3_stmt*",
1140
+ * "int"]` from Evolu's supplement: SQLite's build replaces it with a JavaScript
1141
+ * proxy that keeps embedded NUL characters (proxy-text-apis).
1142
+ *
1143
+ * See https://sqlite.org/c3ref/column_blob.html.
1144
+ */
1145
+ export const sqlite3_column_text = (deps) => deps.sqliteWasm.exports.sqlite3_column_text;
1146
+ /**
1147
+ * Returns the address of a result column's bytes, or NULL for a zero-length
1148
+ * blob, SQL NULL or out of memory; call it before {@link sqlite3_column_bytes}.
1149
+ * The memory stays valid until a type conversion of the column or the next
1150
+ * step, reset or finalize, and SQLite frees it.
1151
+ *
1152
+ * Wasm type `i(ii)`. Signature `["sqlite3_column_blob", "*", "sqlite3_stmt*",
1153
+ * "int"]` from SQLite's table.
1154
+ *
1155
+ * See https://sqlite.org/c3ref/column_blob.html.
1156
+ */
1157
+ export const sqlite3_column_blob = (deps) => deps.sqliteWasm.exports.sqlite3_column_blob;
1158
+ /**
1159
+ * Returns the byte length of the text or blob the preceding column call
1160
+ * returned.
1161
+ *
1162
+ * Wasm type `i(ii)`. Signature `["sqlite3_column_bytes", "int",
1163
+ * "sqlite3_stmt*", "int"]` from SQLite's table.
1164
+ *
1165
+ * See https://sqlite.org/c3ref/column_blob.html.
1166
+ */
1167
+ export const sqlite3_column_bytes = (deps) => deps.sqliteWasm.exports.sqlite3_column_bytes;
1168
+ /**
1169
+ * Returns a result column of the current row as an unprotected sqlite3_value,
1170
+ * valid until the next step, reset or finalize. This build is single-threaded
1171
+ * (SQLITE_THREADSAFE=0), so an unprotected value works wherever a protected one
1172
+ * does, and {@link sqlite3_value_dup} copies it to outlive the row.
1173
+ *
1174
+ * Wasm type `i(ii)`. Signature `["sqlite3_column_value", "sqlite3_value*",
1175
+ * "sqlite3_stmt*", "int"]` from SQLite's table.
1176
+ *
1177
+ * See https://sqlite.org/c3ref/column_blob.html.
1178
+ */
1179
+ export const sqlite3_column_value = (deps) => deps.sqliteWasm.exports.sqlite3_column_value;
1180
+ /**
1181
+ * Returns a value's initial fundamental data type. Read it before the other
1182
+ * value functions, whose conversions can change it.
1183
+ *
1184
+ * Wasm type `i(i)`. Signature `["sqlite3_value_type", "int", "sqlite3_value*"]`
1185
+ * from SQLite's table.
1186
+ *
1187
+ * See https://sqlite.org/c3ref/value_blob.html.
1188
+ */
1189
+ export const sqlite3_value_type = (deps) => deps.sqliteWasm.exports.sqlite3_value_type;
1190
+ /**
1191
+ * Converts a value that looks like a number to INTEGER or FLOAT when no
1192
+ * information is lost, and returns its resulting fundamental data type.
1193
+ *
1194
+ * Wasm type `i(i)`. Signature `["sqlite3_value_numeric_type", "int",
1195
+ * "sqlite3_value*"]` from SQLite's table.
1196
+ *
1197
+ * See https://sqlite.org/c3ref/value_blob.html.
1198
+ */
1199
+ export const sqlite3_value_numeric_type = (deps) => deps.sqliteWasm.exports.sqlite3_value_numeric_type;
1200
+ /**
1201
+ * Returns a value as a 32-bit integer, converting other types as CAST does and
1202
+ * truncating a larger integer to its low 32 bits, and 0 for NULL.
1203
+ *
1204
+ * Wasm type `i(i)`. Signature `["sqlite3_value_int", "int", "sqlite3_value*"]`
1205
+ * from SQLite's table.
1206
+ *
1207
+ * See https://sqlite.org/c3ref/value_blob.html.
1208
+ */
1209
+ export const sqlite3_value_int = (deps) => deps.sqliteWasm.exports.sqlite3_value_int;
1210
+ /**
1211
+ * Returns a value as a 64-bit integer, converting other storage classes as
1212
+ * {@link sqlite3_column_int64} does.
1213
+ *
1214
+ * Wasm type `j(i)`. Signature `["sqlite3_value_int64", "i64",
1215
+ * "sqlite3_value*"]` from SQLite's table.
1216
+ *
1217
+ * See https://sqlite.org/c3ref/value_blob.html.
1218
+ */
1219
+ export const sqlite3_value_int64 = (deps) => deps.sqliteWasm.exports.sqlite3_value_int64;
1220
+ /**
1221
+ * Returns a value as a double, converting other types as CAST does, and 0.0 for
1222
+ * NULL.
1223
+ *
1224
+ * Wasm type `d(i)`. Signature `["sqlite3_value_double", "f64",
1225
+ * "sqlite3_value*"]` from SQLite's table.
1226
+ *
1227
+ * See https://sqlite.org/c3ref/value_blob.html.
1228
+ */
1229
+ export const sqlite3_value_double = (deps) => deps.sqliteWasm.exports.sqlite3_value_double;
1230
+ /**
1231
+ * Returns the address of a protected value as NUL-terminated UTF-8 text that
1232
+ * can contain NUL characters, so read its length with
1233
+ * {@link sqlite3_value_bytes} afterwards. Returns NULL for SQL NULL and when out
1234
+ * of memory, and a later call that converts the value can invalidate the text.
1235
+ *
1236
+ * Wasm type `i(i)`. Signature `["sqlite3_value_text", "*", "sqlite3_value*"]`
1237
+ * from Evolu's supplement: SQLite's build replaces it with a JavaScript proxy
1238
+ * that keeps embedded NUL characters (proxy-text-apis).
1239
+ *
1240
+ * See https://sqlite.org/c3ref/value_blob.html.
1241
+ */
1242
+ export const sqlite3_value_text = (deps) => deps.sqliteWasm.exports.sqlite3_value_text;
1243
+ /**
1244
+ * Returns the address of a value's bytes, rendering a number as text, or NULL
1245
+ * for a zero-length value or SQL NULL. Call it before
1246
+ * {@link sqlite3_value_bytes}; a later text conversion invalidates the address.
1247
+ *
1248
+ * Wasm type `i(i)`. Signature `["sqlite3_value_blob", "*", "sqlite3_value*"]`
1249
+ * from SQLite's table.
1250
+ *
1251
+ * See https://sqlite.org/c3ref/value_blob.html.
1252
+ */
1253
+ export const sqlite3_value_blob = (deps) => deps.sqliteWasm.exports.sqlite3_value_blob;
1254
+ /**
1255
+ * Returns the byte length of the blob or UTF-8 text the preceding
1256
+ * {@link sqlite3_value_blob} or {@link sqlite3_value_text} call returned, without
1257
+ * the NUL terminator; 0 for NULL.
1258
+ *
1259
+ * Wasm type `i(i)`. Signature `["sqlite3_value_bytes", "int",
1260
+ * "sqlite3_value*"]` from SQLite's table.
1261
+ *
1262
+ * See https://sqlite.org/c3ref/value_blob.html.
1263
+ */
1264
+ export const sqlite3_value_bytes = (deps) => deps.sqliteWasm.exports.sqlite3_value_bytes;
1265
+ /**
1266
+ * Returns the pointer {@link sqlite3_bind_pointer} or
1267
+ * {@link sqlite3_result_pointer} attached to a value under a type name equal to
1268
+ * zPType by strcmp, and NULL otherwise.
1269
+ *
1270
+ * Wasm type `i(ii)`. Signature `["sqlite3_value_pointer", "*",
1271
+ * "sqlite3_value*", "string:static"]` from SQLite's table.
1272
+ *
1273
+ * See https://sqlite.org/c3ref/value_blob.html.
1274
+ */
1275
+ export const sqlite3_value_pointer = (deps) => deps.sqliteWasm.exports.sqlite3_value_pointer;
1276
+ /**
1277
+ * Returns the subtype of an application-defined function argument, as
1278
+ * {@link sqlite3_result_subtype} set it, or 0. The reading function should be
1279
+ * registered with SQLITE_SUBTYPE, or it might get 0 in corner cases.
1280
+ *
1281
+ * Wasm type `i(i)`. Signature `["sqlite3_value_subtype", "int",
1282
+ * "sqlite3_value*"]` from SQLite's table.
1283
+ *
1284
+ * See https://sqlite.org/c3ref/value_subtype.html.
1285
+ */
1286
+ export const sqlite3_value_subtype = (deps) => deps.sqliteWasm.exports.sqlite3_value_subtype;
1287
+ /**
1288
+ * Returns non-zero when a value came from a bound parameter rather than a
1289
+ * literal, a column or an expression.
1290
+ *
1291
+ * Wasm type `i(i)`. Signature `["sqlite3_value_frombind", "int",
1292
+ * "sqlite3_value*"]` from SQLite's table.
1293
+ *
1294
+ * See https://sqlite.org/c3ref/value_blob.html.
1295
+ */
1296
+ export const sqlite3_value_frombind = (deps) => deps.sqliteWasm.exports.sqlite3_value_frombind;
1297
+ /**
1298
+ * Within a virtual table's xUpdate, returns non-zero when the value's column is
1299
+ * unchanged by the UPDATE because xColumn set no result; such a value otherwise
1300
+ * looks like NULL. Anywhere else the result is meaningless.
1301
+ *
1302
+ * Wasm type `i(i)`. Signature `["sqlite3_value_nochange", "int",
1303
+ * "sqlite3_value*"]` from SQLite's table.
1304
+ *
1305
+ * See https://sqlite.org/c3ref/value_blob.html.
1306
+ */
1307
+ export const sqlite3_value_nochange = (deps) => deps.sqliteWasm.exports.sqlite3_value_nochange;
1308
+ /**
1309
+ * Copies a value into a protected value the caller frees with
1310
+ * {@link sqlite3_value_free}. Returns NULL for NULL or when out of memory, and a
1311
+ * pointer value copies as SQL NULL.
1312
+ *
1313
+ * Wasm type `i(i)`. Signature `["sqlite3_value_dup", "sqlite3_value*",
1314
+ * "sqlite3_value*"]` from SQLite's table.
1315
+ *
1316
+ * See https://sqlite.org/c3ref/value_dup.html.
1317
+ */
1318
+ export const sqlite3_value_dup = (deps) => deps.sqliteWasm.exports.sqlite3_value_dup;
1319
+ /**
1320
+ * Frees a value from {@link sqlite3_value_dup}; NULL is a no-op.
1321
+ *
1322
+ * Wasm type `v(i)`. Signature `["sqlite3_value_free", undefined,
1323
+ * "sqlite3_value*"]` from SQLite's table.
1324
+ *
1325
+ * See https://sqlite.org/c3ref/value_dup.html.
1326
+ */
1327
+ export const sqlite3_value_free = (deps) => deps.sqliteWasm.exports.sqlite3_value_free;
1328
+ /**
1329
+ * Adds, redefines or, with xFunc, xStep and xFinal all NULL, removes an SQL
1330
+ * function of the connection: xFunc implements a scalar function, xStep with
1331
+ * xFinal an aggregate. nArg is the argument count or -1 for any, and eTextRep
1332
+ * the preferred text encoding, optionally with flags such as
1333
+ * SQLITE_DETERMINISTIC and SQLITE_DIRECTONLY.
1334
+ *
1335
+ * Wasm type `i(iiiiiiii)`. Signature `["sqlite3_create_function", "int",
1336
+ * "sqlite3*", "string", "int", "int", "*", "funcptr:v(pip)", "funcptr:v(pip)",
1337
+ * "funcptr:v(p)"]` from Evolu's supplement: SQLite binds it by hand to accept
1338
+ * JavaScript functions as callbacks.
1339
+ *
1340
+ * See https://sqlite.org/c3ref/create_function.html.
1341
+ */
1342
+ export const sqlite3_create_function = (deps) => deps.sqliteWasm.exports.sqlite3_create_function;
1343
+ /**
1344
+ * Works like {@link sqlite3_create_function}, and SQLite calls a non-NULL
1345
+ * xDestroy with pApp when the function is redefined or removed, when the
1346
+ * connection closes, and when this call fails.
1347
+ *
1348
+ * Wasm type `i(iiiiiiiii)`. Signature `["sqlite3_create_function_v2", "int",
1349
+ * "sqlite3*", "string", "int", "int", "*", "funcptr:v(pip)", "funcptr:v(pip)",
1350
+ * "funcptr:v(p)", "funcptr:v(p)"]` from Evolu's supplement: SQLite binds it by
1351
+ * hand to accept JavaScript functions as callbacks.
1352
+ *
1353
+ * See https://sqlite.org/c3ref/create_function.html.
1354
+ */
1355
+ export const sqlite3_create_function_v2 = (deps) => deps.sqliteWasm.exports.sqlite3_create_function_v2;
1356
+ /**
1357
+ * Ensures a global SQL function with this name and argument count exists,
1358
+ * creating a placeholder that raises an error when called, so a virtual table's
1359
+ * xFindFunction can overload it.
1360
+ *
1361
+ * Wasm type `i(iii)`. Signature `["sqlite3_overload_function", "int",
1362
+ * "sqlite3*", "string", "int"]` from SQLite's table.
1363
+ *
1364
+ * See https://sqlite.org/c3ref/overload_function.html.
1365
+ */
1366
+ export const sqlite3_overload_function = (deps) => deps.sqliteWasm.exports.sqlite3_overload_function;
1367
+ /**
1368
+ * Adds, replaces or, with a NULL xCompare, removes a collation named zName for
1369
+ * text in the eTextRep encoding. `xCompare(pArg, n1, s1, n2, s2)` compares two
1370
+ * strings of the given byte lengths and returns a negative number, zero or a
1371
+ * positive number; SQLite behavior is undefined when the comparison is
1372
+ * inconsistent.
1373
+ *
1374
+ * Wasm type `i(iiiii)`. Signature `["sqlite3_create_collation", "int",
1375
+ * "sqlite3*", "string", "int", "*", "funcptr:i(pipip)"]` from Evolu's
1376
+ * supplement: SQLite binds it by hand to accept JavaScript functions as
1377
+ * callbacks.
1378
+ *
1379
+ * See https://sqlite.org/c3ref/create_collation.html.
1380
+ */
1381
+ export const sqlite3_create_collation = (deps) => deps.sqliteWasm.exports.sqlite3_create_collation;
1382
+ /**
1383
+ * Works like {@link sqlite3_create_collation}, and SQLite calls a non-NULL
1384
+ * xDestroy with pArg when the collation is replaced or the connection closes.
1385
+ * Unlike other SQLite functions, it does not call xDestroy when this call
1386
+ * fails, so the caller then disposes of pArg.
1387
+ *
1388
+ * Wasm type `i(iiiiii)`. Signature `["sqlite3_create_collation_v2", "int",
1389
+ * "sqlite3*", "string", "int", "*", "funcptr:i(pipip)", "funcptr:v(p)"]` from
1390
+ * Evolu's supplement: SQLite binds it by hand to accept JavaScript functions as
1391
+ * callbacks.
1392
+ *
1393
+ * See https://sqlite.org/c3ref/create_collation.html.
1394
+ */
1395
+ export const sqlite3_create_collation_v2 = (deps) => deps.sqliteWasm.exports.sqlite3_create_collation_v2;
1396
+ /**
1397
+ * Returns the user data pointer the running application-defined function was
1398
+ * registered with.
1399
+ *
1400
+ * Wasm type `i(i)`. Signature `["sqlite3_user_data", "void*",
1401
+ * "sqlite3_context*"]` from SQLite's table.
1402
+ *
1403
+ * See https://sqlite.org/c3ref/user_data.html.
1404
+ */
1405
+ export const sqlite3_user_data = (deps) => deps.sqliteWasm.exports.sqlite3_user_data;
1406
+ /**
1407
+ * Returns the connection that registered the application-defined function being
1408
+ * called.
1409
+ *
1410
+ * Wasm type `i(i)`. Signature `["sqlite3_context_db_handle", "sqlite3*",
1411
+ * "sqlite3_context*"]` from SQLite's table.
1412
+ *
1413
+ * See https://sqlite.org/c3ref/context_db_handle.html.
1414
+ */
1415
+ export const sqlite3_context_db_handle = (deps) => deps.sqliteWasm.exports.sqlite3_context_db_handle;
1416
+ /**
1417
+ * Returns the state memory of the current aggregate function instance: the
1418
+ * first call allocates nBytes of zeroed memory, later calls return the same
1419
+ * buffer, and SQLite frees it when the aggregate concludes. Returns NULL when
1420
+ * the first call passes nBytes of zero or less or runs out of memory.
1421
+ *
1422
+ * Wasm type `i(ii)`. Signature `["sqlite3_aggregate_context", "void*",
1423
+ * "sqlite3_context*", "int"]` from SQLite's table.
1424
+ *
1425
+ * See https://sqlite.org/c3ref/aggregate_context.html.
1426
+ */
1427
+ export const sqlite3_aggregate_context = (deps) => deps.sqliteWasm.exports.sqlite3_aggregate_context;
1428
+ /**
1429
+ * Returns the auxiliary data {@link sqlite3_set_auxdata} associated with the
1430
+ * 0-based N-th argument of the current function call, or NULL when there is
1431
+ * none or SQLite discarded it.
1432
+ *
1433
+ * Wasm type `i(ii)`. Signature `["sqlite3_get_auxdata", "*",
1434
+ * "sqlite3_context*", "int"]` from SQLite's table.
1435
+ *
1436
+ * See https://sqlite.org/c3ref/get_auxdata.html.
1437
+ */
1438
+ export const sqlite3_get_auxdata = (deps) => deps.sqliteWasm.exports.sqlite3_get_auxdata;
1439
+ /**
1440
+ * Attaches pAux to the N-th argument of the running application-defined
1441
+ * function, where {@link sqlite3_get_auxdata} finds it while the argument stays
1442
+ * the same. SQLite may discard it at any time, even before this call returns,
1443
+ * calling a non-NULL xDelete with pAux, so pAux must not be used afterwards.
1444
+ *
1445
+ * Wasm type `v(iiii)`. Signature `["sqlite3_set_auxdata", undefined,
1446
+ * "sqlite3_context*", "int", "*", "*"]` from SQLite's table.
1447
+ *
1448
+ * See https://sqlite.org/c3ref/get_auxdata.html.
1449
+ */
1450
+ export const sqlite3_set_auxdata = (deps) => deps.sqliteWasm.exports.sqlite3_set_auxdata;
1451
+ /**
1452
+ * Sets an application-defined function's result to NULL.
1453
+ *
1454
+ * Wasm type `v(i)`. Signature `["sqlite3_result_null", undefined,
1455
+ * "sqlite3_context*"]` from SQLite's table.
1456
+ *
1457
+ * See https://sqlite.org/c3ref/result_blob.html.
1458
+ */
1459
+ export const sqlite3_result_null = (deps) => deps.sqliteWasm.exports.sqlite3_result_null;
1460
+ /**
1461
+ * Sets an application-defined function's result to a 32-bit integer. The wasm
1462
+ * boundary converts the number with ToInt32, so a fraction is truncated and a
1463
+ * value outside the int32 range wraps silently.
1464
+ *
1465
+ * Wasm type `v(ii)`. Signature `["sqlite3_result_int", undefined,
1466
+ * "sqlite3_context*", "int"]` from SQLite's table.
1467
+ *
1468
+ * See https://sqlite.org/c3ref/result_blob.html.
1469
+ */
1470
+ export const sqlite3_result_int = (deps) => deps.sqliteWasm.exports.sqlite3_result_int;
1471
+ /**
1472
+ * Sets an application-defined function's result to a 64-bit integer. The wasm
1473
+ * boundary wraps a bigint outside the int64 range silently.
1474
+ *
1475
+ * Wasm type `v(ij)`. Signature `["sqlite3_result_int64", undefined, "*",
1476
+ * "i64"]` from SQLite's table.
1477
+ *
1478
+ * See https://sqlite.org/c3ref/result_blob.html.
1479
+ */
1480
+ export const sqlite3_result_int64 = (deps) => deps.sqliteWasm.exports.sqlite3_result_int64;
1481
+ /**
1482
+ * Sets an application-defined function's result to a double; SQLite stores NaN
1483
+ * as NULL.
1484
+ *
1485
+ * Wasm type `v(id)`. Signature `["sqlite3_result_double", undefined,
1486
+ * "sqlite3_context*", "f64"]` from SQLite's table.
1487
+ *
1488
+ * See https://sqlite.org/c3ref/result_blob.html.
1489
+ */
1490
+ export const sqlite3_result_double = (deps) => deps.sqliteWasm.exports.sqlite3_result_double;
1491
+ /**
1492
+ * Sets an application-defined function's result to UTF-8 text of n bytes, or up
1493
+ * to its NUL terminator when n is negative. A NULL address sets SQL NULL, as
1494
+ * for {@link sqlite3_bind_text}.
1495
+ *
1496
+ * Wasm type `v(iiii)`. Signature `["sqlite3_result_text", undefined,
1497
+ * "sqlite3_context*", "string", "int", "*"]` from SQLite's table.
1498
+ *
1499
+ * See https://sqlite.org/c3ref/result_blob.html.
1500
+ */
1501
+ export const sqlite3_result_text = (deps) => deps.sqliteWasm.exports.sqlite3_result_text;
1502
+ /**
1503
+ * Sets an application-defined function's result to n bytes. A NULL address sets
1504
+ * SQL NULL, as for {@link sqlite3_bind_blob}, so an empty blob needs a non-NULL
1505
+ * address or {@link sqlite3_result_zeroblob}.
1506
+ *
1507
+ * Wasm type `v(iiii)`. Signature `["sqlite3_result_blob", undefined,
1508
+ * "sqlite3_context*", "*", "int", "*"]` from SQLite's table.
1509
+ *
1510
+ * See https://sqlite.org/c3ref/result_blob.html.
1511
+ */
1512
+ export const sqlite3_result_blob = (deps) => deps.sqliteWasm.exports.sqlite3_result_blob;
1513
+ /**
1514
+ * Sets an application-defined function's result to a blob of n zero bytes, 0
1515
+ * for a negative n. A size beyond SQLITE_LIMIT_LENGTH makes the function fail
1516
+ * with SQLITE_TOOBIG.
1517
+ *
1518
+ * Wasm type `v(ii)`. Signature `["sqlite3_result_zeroblob", undefined,
1519
+ * "sqlite3_context*", "int"]` from SQLite's table.
1520
+ *
1521
+ * See https://sqlite.org/c3ref/result_blob.html.
1522
+ */
1523
+ export const sqlite3_result_zeroblob = (deps) => deps.sqliteWasm.exports.sqlite3_result_zeroblob;
1524
+ /**
1525
+ * Sets an application-defined function's result to a blob of n zero bytes.
1526
+ * Returns SQLITE_TOOBIG, and makes the function fail with that error, when n
1527
+ * exceeds the connection's length limit.
1528
+ *
1529
+ * Wasm type `i(ij)`. Signature `["sqlite3_result_zeroblob64", "int", "*",
1530
+ * "i64"]` from SQLite's table.
1531
+ *
1532
+ * See https://sqlite.org/c3ref/result_blob.html.
1533
+ */
1534
+ export const sqlite3_result_zeroblob64 = (deps) => deps.sqliteWasm.exports.sqlite3_result_zeroblob64;
1535
+ /**
1536
+ * Sets an application-defined function's result to an SQL NULL carrying pPtr,
1537
+ * which {@link sqlite3_value_pointer} returns for an equal type name. SQLite
1538
+ * keeps zPType itself, so it must outlive the value, and calls a non-NULL
1539
+ * xDestructor with pPtr when done with it.
1540
+ *
1541
+ * Wasm type `v(iiii)`. Signature `["sqlite3_result_pointer", undefined,
1542
+ * "sqlite3_context*", "*", "string:static", "*"]` from SQLite's table.
1543
+ *
1544
+ * See https://sqlite.org/c3ref/result_blob.html.
1545
+ */
1546
+ export const sqlite3_result_pointer = (deps) => deps.sqliteWasm.exports.sqlite3_result_pointer;
1547
+ /**
1548
+ * Sets the subtype of an application-defined function's result, keeping only
1549
+ * its low 8 bits. The function must be registered with SQLITE_RESULT_SUBTYPE:
1550
+ * without it the subtype might not be set, and a build with
1551
+ * SQLITE_STRICT_SUBTYPE, such as this one, fails the function with an error.
1552
+ * SQLite's table declares the first parameter as sqlite3_value*, but the C
1553
+ * function takes sqlite3_context*.
1554
+ *
1555
+ * Wasm type `v(ii)`. Signature `["sqlite3_result_subtype", undefined,
1556
+ * "sqlite3_value*", "int"]` from SQLite's table.
1557
+ *
1558
+ * See https://sqlite.org/c3ref/result_subtype.html.
1559
+ */
1560
+ export const sqlite3_result_subtype = (deps) => deps.sqliteWasm.exports.sqlite3_result_subtype;
1561
+ /**
1562
+ * Makes an application-defined function fail with a copy of a UTF-8 message of
1563
+ * n bytes, or up to its NUL terminator when n is negative. It resets the error
1564
+ * code to SQLITE_ERROR, so call {@link sqlite3_result_error_code} after it.
1565
+ *
1566
+ * Wasm type `v(iii)`. Signature `["sqlite3_result_error", undefined,
1567
+ * "sqlite3_context*", "string", "int"]` from SQLite's table.
1568
+ *
1569
+ * See https://sqlite.org/c3ref/result_blob.html.
1570
+ */
1571
+ export const sqlite3_result_error = (deps) => deps.sqliteWasm.exports.sqlite3_result_error;
1572
+ /**
1573
+ * Makes an application-defined function fail with a result code instead of
1574
+ * SQLITE_ERROR, and with the code's default message when no result was set.
1575
+ * Call it after {@link sqlite3_result_error}, which resets the code to
1576
+ * SQLITE_ERROR.
1577
+ *
1578
+ * Wasm type `v(ii)`. Signature `["sqlite3_result_error_code", undefined,
1579
+ * "sqlite3_context*", "int"]` from SQLite's table.
1580
+ *
1581
+ * See https://sqlite.org/c3ref/result_blob.html.
1582
+ */
1583
+ export const sqlite3_result_error_code = (deps) => deps.sqliteWasm.exports.sqlite3_result_error_code;
1584
+ /**
1585
+ * Makes an application-defined function fail with SQLITE_NOMEM, as a failed
1586
+ * memory allocation would.
1587
+ *
1588
+ * Wasm type `v(i)`. Signature `["sqlite3_result_error_nomem", undefined,
1589
+ * "sqlite3_context*"]` from SQLite's table.
1590
+ *
1591
+ * See https://sqlite.org/c3ref/result_blob.html.
1592
+ */
1593
+ export const sqlite3_result_error_nomem = (deps) => deps.sqliteWasm.exports.sqlite3_result_error_nomem;
1594
+ /**
1595
+ * Makes an application-defined function fail with SQLITE_TOOBIG, reporting a
1596
+ * string or blob too big to represent.
1597
+ *
1598
+ * Wasm type `v(i)`. Signature `["sqlite3_result_error_toobig", undefined,
1599
+ * "sqlite3_context*"]` from SQLite's table.
1600
+ *
1601
+ * See https://sqlite.org/c3ref/result_blob.html.
1602
+ */
1603
+ export const sqlite3_result_error_toobig = (deps) => deps.sqliteWasm.exports.sqlite3_result_error_toobig;
1604
+ /**
1605
+ * Returns the value of a URI query parameter of a filename, an empty string for
1606
+ * a parameter without a value, or NULL when it is absent or the filename is
1607
+ * NULL.
1608
+ *
1609
+ * Wasm type `i(ii)`. Signature `["sqlite3_uri_parameter", "string",
1610
+ * "sqlite3_filename", "string"]` from SQLite's table.
1611
+ *
1612
+ * See https://sqlite.org/c3ref/uri_boolean.html.
1613
+ */
1614
+ export const sqlite3_uri_parameter = (deps) => deps.sqliteWasm.exports.sqlite3_uri_parameter;
1615
+ /**
1616
+ * Returns 1 when a filename's URI query parameter is yes, true or on in any
1617
+ * case or starts with a non-zero number, 0 when it is no, false or off or
1618
+ * starts with zero, and whether bDefault is non-zero otherwise, including for a
1619
+ * NULL filename.
1620
+ *
1621
+ * Wasm type `i(iii)`. Signature `["sqlite3_uri_boolean", "int",
1622
+ * "sqlite3_filename", "string", "int"]` from SQLite's table.
1623
+ *
1624
+ * See https://sqlite.org/c3ref/uri_boolean.html.
1625
+ */
1626
+ export const sqlite3_uri_boolean = (deps) => deps.sqliteWasm.exports.sqlite3_uri_boolean;
1627
+ /**
1628
+ * Returns a URI query parameter of a filename SQLite created as a 64-bit
1629
+ * integer, or iDefault when the filename is NULL or the parameter is missing or
1630
+ * not a decimal or hexadecimal integer.
1631
+ *
1632
+ * Wasm type `j(iij)`. Signature `["sqlite3_uri_int64", "i64",
1633
+ * "sqlite3_filename", "string", "i64"]` from SQLite's table.
1634
+ *
1635
+ * See https://sqlite.org/c3ref/uri_boolean.html.
1636
+ */
1637
+ export const sqlite3_uri_int64 = (deps) => deps.sqliteWasm.exports.sqlite3_uri_int64;
1638
+ /**
1639
+ * Returns the name of a filename's N-th URI query parameter, counting from 0,
1640
+ * or NULL when N is out of range.
1641
+ *
1642
+ * Wasm type `i(ii)`. Signature `["sqlite3_uri_key", "string",
1643
+ * "sqlite3_filename", "int"]` from SQLite's table.
1644
+ *
1645
+ * See https://sqlite.org/c3ref/uri_boolean.html.
1646
+ */
1647
+ export const sqlite3_uri_key = (deps) => deps.sqliteWasm.exports.sqlite3_uri_key;
1648
+ /**
1649
+ * Returns a registered VFS by name, or the default VFS for NULL.
1650
+ *
1651
+ * Wasm type `i(i)`. Signature `["sqlite3_vfs_find", "*", "string"]` from
1652
+ * SQLite's table.
1653
+ *
1654
+ * See https://sqlite.org/c3ref/vfs_find.html.
1655
+ */
1656
+ export const sqlite3_vfs_find = (deps) => deps.sqliteWasm.exports.sqlite3_vfs_find;
1657
+ /**
1658
+ * Registers a VFS, optionally as the default. The struct and its name must
1659
+ * outlive the registration.
1660
+ *
1661
+ * Wasm type `i(ii)`. Signature `["sqlite3_vfs_register", "int", "sqlite3_vfs*",
1662
+ * "int"]` from SQLite's table.
1663
+ *
1664
+ * See https://sqlite.org/c3ref/vfs_find.html.
1665
+ */
1666
+ export const sqlite3_vfs_register = (deps) => deps.sqliteWasm.exports.sqlite3_vfs_register;
1667
+ /**
1668
+ * Unregisters a VFS. When it was the default, SQLite makes an arbitrary other
1669
+ * VFS the default.
1670
+ *
1671
+ * Wasm type `i(i)`. Signature `["sqlite3_vfs_unregister", "int",
1672
+ * "sqlite3_vfs*"]` from SQLite's table.
1673
+ *
1674
+ * See https://sqlite.org/c3ref/vfs_find.html.
1675
+ */
1676
+ export const sqlite3_vfs_unregister = (deps) => deps.sqliteWasm.exports.sqlite3_vfs_unregister;
1677
+ /**
1678
+ * Returns the ON CONFLICT mode of the statement that called xUpdate for an
1679
+ * INSERT or UPDATE: SQLITE_ROLLBACK, SQLITE_IGNORE, SQLITE_FAIL, SQLITE_ABORT
1680
+ * or SQLITE_REPLACE. Only xUpdate may call it.
1681
+ *
1682
+ * Wasm type `i(i)`. Signature `["sqlite3_vtab_on_conflict", "int", "sqlite3*"]`
1683
+ * from SQLite's table.
1684
+ *
1685
+ * See https://sqlite.org/c3ref/vtab_on_conflict.html.
1686
+ */
1687
+ export const sqlite3_vtab_on_conflict = (deps) => deps.sqliteWasm.exports.sqlite3_vtab_on_conflict;
1688
+ /**
1689
+ * Returns non-zero inside xColumn when the column is fetched for an UPDATE that
1690
+ * does not change it, so xColumn may leave the result unset. It is only a hint
1691
+ * and may always return 0.
1692
+ *
1693
+ * Wasm type `i(i)`. Signature `["sqlite3_vtab_nochange", "int",
1694
+ * "sqlite3_context*"]` from SQLite's table.
1695
+ *
1696
+ * See https://sqlite.org/c3ref/vtab_nochange.html.
1697
+ */
1698
+ export const sqlite3_vtab_nochange = (deps) => deps.sqliteWasm.exports.sqlite3_vtab_nochange;
1699
+ /**
1700
+ * Returns the collation name for text comparisons of an xBestIndex constraint,
1701
+ * `BINARY` by default, or NULL for an index outside aConstraint. Only
1702
+ * xBestIndex may call it, with the sqlite3_index_info it received.
1703
+ *
1704
+ * Wasm type `i(ii)`. Signature `["sqlite3_vtab_collation", "string",
1705
+ * "sqlite3_index_info*", "int"]` from SQLite's table.
1706
+ *
1707
+ * See https://sqlite.org/c3ref/vtab_collation.html.
1708
+ */
1709
+ export const sqlite3_vtab_collation = (deps) => deps.sqliteWasm.exports.sqlite3_vtab_collation;
1710
+ /**
1711
+ * Returns how the planner needs a virtual table's rows for orderByConsumed: 0
1712
+ * in aOrderBy order, 1 with equal aOrderBy values adjacent, 2 adjacent with
1713
+ * duplicates over colUsed omittable, 3 in order with such duplicates omittable.
1714
+ * Only xBestIndex may call it.
1715
+ *
1716
+ * Wasm type `i(i)`. Signature `["sqlite3_vtab_distinct", "int",
1717
+ * "sqlite3_index_info*"]` from SQLite's table.
1718
+ *
1719
+ * See https://sqlite.org/c3ref/vtab_distinct.html.
1720
+ */
1721
+ export const sqlite3_vtab_distinct = (deps) => deps.sqliteWasm.exports.sqlite3_vtab_distinct;
1722
+ /**
1723
+ * Returns non-zero when constraint iCons is an IN operator that can be
1724
+ * processed all at once; bHandle 1 or 0 requests or declines that processing,
1725
+ * and -1 only asks. Only xBestIndex may call it.
1726
+ *
1727
+ * Wasm type `i(iii)`. Signature `["sqlite3_vtab_in", "int",
1728
+ * "sqlite3_index_info*", "int", "int"]` from SQLite's table.
1729
+ *
1730
+ * See https://sqlite.org/c3ref/vtab_in.html.
1731
+ */
1732
+ export const sqlite3_vtab_in = (deps) => deps.sqliteWasm.exports.sqlite3_vtab_in;
1733
+ /**
1734
+ * Writes the first right-hand value of an all-at-once IN constraint, given its
1735
+ * xFilter argument, to ppOut and returns SQLITE_OK, or writes NULL and returns
1736
+ * SQLITE_DONE when there is none. The value stays valid until the next call or
1737
+ * the end of xFilter.
1738
+ *
1739
+ * Wasm type `i(ii)`. Signature `["sqlite3_vtab_in_first", "int",
1740
+ * "sqlite3_value*", "**"]` from SQLite's table.
1741
+ *
1742
+ * See https://sqlite.org/c3ref/vtab_in_first.html.
1743
+ */
1744
+ export const sqlite3_vtab_in_first = (deps) => deps.sqliteWasm.exports.sqlite3_vtab_in_first;
1745
+ /**
1746
+ * Writes the next right-hand value of an all-at-once IN constraint, given its
1747
+ * xFilter argument, to ppOut and returns SQLITE_OK, or writes NULL and returns
1748
+ * SQLITE_DONE after the last. The value stays valid until the next call or the
1749
+ * end of xFilter.
1750
+ *
1751
+ * Wasm type `i(ii)`. Signature `["sqlite3_vtab_in_next", "int",
1752
+ * "sqlite3_value*", "**"]` from SQLite's table.
1753
+ *
1754
+ * See https://sqlite.org/c3ref/vtab_in_first.html.
1755
+ */
1756
+ export const sqlite3_vtab_in_next = (deps) => deps.sqliteWasm.exports.sqlite3_vtab_in_next;
1757
+ /**
1758
+ * Writes the right-hand value of constraint iCons to ppVal and returns
1759
+ * SQLITE_OK, or writes NULL and returns SQLITE_NOTFOUND when it is not known,
1760
+ * which is usual unless it is a literal. Only xBestIndex may call it, and the
1761
+ * value is freed when xBestIndex returns.
1762
+ *
1763
+ * Wasm type `i(iii)`. Signature `["sqlite3_vtab_rhs_value", "int",
1764
+ * "sqlite3_index_info*", "int", "**"]` from SQLite's table.
1765
+ *
1766
+ * See https://sqlite.org/c3ref/vtab_rhs_value.html.
1767
+ */
1768
+ export const sqlite3_vtab_rhs_value = (deps) => deps.sqliteWasm.exports.sqlite3_vtab_rhs_value;
1769
+ /**
1770
+ * Changes a global option of the library, which works only before
1771
+ * {@link sqlite3_initialize} or after {@link sqlite3_shutdown} and otherwise
1772
+ * returns SQLITE_MISUSE. The loader initializes the library, so call it after
1773
+ * sqlite3_shutdown, then initialize the library again with
1774
+ * initializeSqliteWasm, as sqlite3_shutdown explains.
1775
+ *
1776
+ * - SQLITE_CONFIG_MEMSTATUS, SQLITE_CONFIG_SMALL_MALLOC, SQLITE_CONFIG_URI and
1777
+ * SQLITE_CONFIG_COVERING_INDEX_SCAN turn a feature on for a non-zero value
1778
+ * and off for 0.
1779
+ * - SQLITE_CONFIG_STMTJRNL_SPILL sets the byte size above which statement
1780
+ * journals spill to disk. SQLITE_CONFIG_SORTERREF_SIZE fails with
1781
+ * SQLITE_ERROR, since this build does not enable sorter references.
1782
+ * - SQLITE_CONFIG_LOOKASIDE sets the default lookaside allocator of new
1783
+ * connections to cnt slots of sz bytes.
1784
+ * - SQLITE_CONFIG_MEMDB_MAXSIZE sets the default maximum size of a database
1785
+ * {@link sqlite3_deserialize} creates.
1786
+ *
1787
+ * The C function is variadic, so the binary does not export it. This calls the
1788
+ * build's shim for the option's arguments and, as SQLite's JavaScript does,
1789
+ * returns SQLITE_NOTFOUND for every other option without calling wasm, because
1790
+ * the shims pass their arguments to the C function unchecked.
1791
+ *
1792
+ * Calls the build's shims, whose signatures come from Evolu's metadata because
1793
+ * SQLite's table omits them:
1794
+ *
1795
+ * - `sqlite3__wasm_config_i`, wasm type `i(ii)`, signature
1796
+ * `["sqlite3__wasm_config_i", "int", "int", "int"]`.
1797
+ * - `sqlite3__wasm_config_ii`, wasm type `i(iii)`, signature
1798
+ * `["sqlite3__wasm_config_ii", "int", "int", "int", "int"]`.
1799
+ * - `sqlite3__wasm_config_j`, wasm type `i(ij)`, signature
1800
+ * `["sqlite3__wasm_config_j", "int", "int", "i64"]`.
1801
+ *
1802
+ * See https://sqlite.org/c3ref/config.html.
1803
+ */
1804
+ export const sqlite3_config = (deps) => {
1805
+ const { sqlite3__wasm_config_i, sqlite3__wasm_config_ii, sqlite3__wasm_config_j, } = deps.sqliteWasm.exports;
1806
+ return (...args) => {
1807
+ switch (args[0]) {
1808
+ case SQLITE_CONFIG_MEMSTATUS:
1809
+ case SQLITE_CONFIG_URI:
1810
+ case SQLITE_CONFIG_COVERING_INDEX_SCAN:
1811
+ case SQLITE_CONFIG_STMTJRNL_SPILL:
1812
+ case SQLITE_CONFIG_SMALL_MALLOC:
1813
+ case SQLITE_CONFIG_SORTERREF_SIZE:
1814
+ return sqlite3__wasm_config_i(args[0], args[1]);
1815
+ case SQLITE_CONFIG_LOOKASIDE:
1816
+ return sqlite3__wasm_config_ii(args[0], args[1], args[2]);
1817
+ case SQLITE_CONFIG_MEMDB_MAXSIZE:
1818
+ return sqlite3__wasm_config_j(args[0], args[1]);
1819
+ default:
1820
+ // TypeScript rejects other options, but JavaScript and casts can pass
1821
+ // them.
1822
+ return SQLITE_NOTFOUND;
1823
+ }
1824
+ };
1825
+ };
1826
+ /**
1827
+ * Changes or reads an option of a connection, returning SQLITE_OK or an error
1828
+ * code.
1829
+ *
1830
+ * - SQLITE_DBCONFIG_MAINDBNAME renames the main schema to zName, which SQLite
1831
+ * does not copy, so it must stay unchanged until the connection closes.
1832
+ * - SQLITE_DBCONFIG_LOOKASIDE sets the connection's lookaside allocator to cnt
1833
+ * slots of sz bytes in buf, which must be 8-byte aligned and hold sz times
1834
+ * cnt bytes, or in memory SQLite allocates for a NULL buf. It fails with
1835
+ * SQLITE_BUSY while lookaside memory is in use.
1836
+ * - SQLITE_DBCONFIG_FP_DIGITS sets the significant digits of floating-point to
1837
+ * text conversion to value when it is from 4 to 23, leaving the setting
1838
+ * unchanged otherwise, and writes the resulting setting to the int at pResult
1839
+ * unless it is NULL.
1840
+ * - Every other option is a flag: a positive value sets it, 0 clears it and a
1841
+ * negative value only reads it, and the resulting 0 or 1 is written to the
1842
+ * int at pResult unless it is NULL. Changing a flag expires the connection's
1843
+ * prepared statements.
1844
+ *
1845
+ * The C function is variadic, so the binary does not export it. This calls the
1846
+ * build's shim for the option's arguments and, as SQLite's JavaScript does,
1847
+ * returns SQLITE_MISUSE for any other option without calling wasm.
1848
+ *
1849
+ * Calls the build's shims, whose signatures come from Evolu's metadata because
1850
+ * SQLite's table omits them:
1851
+ *
1852
+ * - `sqlite3__wasm_db_config_s`, wasm type `i(iii)`, signature
1853
+ * `["sqlite3__wasm_db_config_s", "int", "sqlite3*", "int", "string"]`.
1854
+ * - `sqlite3__wasm_db_config_pii`, wasm type `i(iiiii)`, signature
1855
+ * `["sqlite3__wasm_db_config_pii", "int", "sqlite3*", "int", "*", "int",
1856
+ * "int"]`.
1857
+ * - `sqlite3__wasm_db_config_ip`, wasm type `i(iiii)`, signature
1858
+ * `["sqlite3__wasm_db_config_ip", "int", "sqlite3*", "int", "int", "int*"]`.
1859
+ *
1860
+ * See https://sqlite.org/c3ref/db_config.html.
1861
+ */
1862
+ export const sqlite3_db_config = (deps) => {
1863
+ const { sqlite3__wasm_db_config_s, sqlite3__wasm_db_config_pii, sqlite3__wasm_db_config_ip, } = deps.sqliteWasm.exports;
1864
+ return (db, ...args) => {
1865
+ switch (args[0]) {
1866
+ case SQLITE_DBCONFIG_MAINDBNAME:
1867
+ return sqlite3__wasm_db_config_s(db, args[0], args[1]);
1868
+ case SQLITE_DBCONFIG_LOOKASIDE:
1869
+ return sqlite3__wasm_db_config_pii(db, args[0], args[1], args[2], args[3]);
1870
+ case SQLITE_DBCONFIG_ENABLE_FKEY:
1871
+ case SQLITE_DBCONFIG_ENABLE_TRIGGER:
1872
+ case SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION:
1873
+ case SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE:
1874
+ case SQLITE_DBCONFIG_ENABLE_QPSG:
1875
+ case SQLITE_DBCONFIG_TRIGGER_EQP:
1876
+ case SQLITE_DBCONFIG_RESET_DATABASE:
1877
+ case SQLITE_DBCONFIG_DEFENSIVE:
1878
+ case SQLITE_DBCONFIG_WRITABLE_SCHEMA:
1879
+ case SQLITE_DBCONFIG_LEGACY_ALTER_TABLE:
1880
+ case SQLITE_DBCONFIG_DQS_DML:
1881
+ case SQLITE_DBCONFIG_DQS_DDL:
1882
+ case SQLITE_DBCONFIG_ENABLE_VIEW:
1883
+ case SQLITE_DBCONFIG_LEGACY_FILE_FORMAT:
1884
+ case SQLITE_DBCONFIG_TRUSTED_SCHEMA:
1885
+ case SQLITE_DBCONFIG_STMT_SCANSTATUS:
1886
+ case SQLITE_DBCONFIG_REVERSE_SCANORDER:
1887
+ case SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE:
1888
+ case SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE:
1889
+ case SQLITE_DBCONFIG_ENABLE_COMMENTS:
1890
+ case SQLITE_DBCONFIG_FP_DIGITS:
1891
+ return sqlite3__wasm_db_config_ip(db, args[0], args[1], args[2] ?? 0);
1892
+ default:
1893
+ // TypeScript rejects other options, but JavaScript and casts can pass
1894
+ // them.
1895
+ return SQLITE_MISUSE;
1896
+ }
1897
+ };
1898
+ };
1899
+ /**
1900
+ * Sets an option of the virtual table whose xCreate or xConnect method is
1901
+ * running, the only place it may be called.
1902
+ *
1903
+ * - SQLITE_VTAB_CONSTRAINT_SUPPORT with a non-zero value declares that xUpdate
1904
+ * returns SQLITE_CONSTRAINT only before changing anything, so SQLite can
1905
+ * honor the statement's ON CONFLICT mode.
1906
+ * - SQLITE_VTAB_INNOCUOUS marks the virtual table as safe to use in triggers and
1907
+ * views, and SQLITE_VTAB_DIRECTONLY prohibits that. Both ignore value.
1908
+ *
1909
+ * The C function is variadic, so the binary does not export it. The build's
1910
+ * shim returns SQLITE_MISUSE for any other option, including
1911
+ * SQLITE_VTAB_USES_ALL_SCHEMAS, which it does not support.
1912
+ *
1913
+ * Returns the build's shim `sqlite3__wasm_vtab_config`, wasm type `i(iii)`,
1914
+ * signature `["sqlite3__wasm_vtab_config", "int", "sqlite3*", "int", "int"]`.
1915
+ * Its signature comes from Evolu's metadata because SQLite's table omits it.
1916
+ *
1917
+ * See https://sqlite.org/c3ref/vtab_config.html.
1918
+ */
1919
+ export const sqlite3_vtab_config = (deps) => deps.sqliteWasm.exports.sqlite3__wasm_vtab_config;