@powersync/web 0.0.0-dev-20251203144301 → 0.0.0-dev-20260112083235

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 (107) hide show
  1. package/README.md +1 -1
  2. package/dist/0b19af1befc07ce338dd.wasm +0 -0
  3. package/dist/2632c3bda9473da74fd5.wasm +0 -0
  4. package/dist/64f5351ba3784bfe2f3e.wasm +0 -0
  5. package/dist/9318ca94aac4d0fe0135.wasm +0 -0
  6. package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-89f0ba.index.umd.js +1875 -0
  7. package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-89f0ba.index.umd.js.map +1 -0
  8. package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-685f6c0.index.umd.js +567 -0
  9. package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-685f6c0.index.umd.js.map +1 -0
  10. package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-685f6c1.index.umd.js +567 -0
  11. package/dist/_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapps_wa-sqlite_src_example-685f6c1.index.umd.js.map +1 -0
  12. package/dist/index.umd.js +7107 -4249
  13. package/dist/index.umd.js.map +1 -1
  14. package/dist/worker/SharedSyncImplementation.umd.js +337 -2101
  15. package/dist/worker/SharedSyncImplementation.umd.js.map +1 -1
  16. package/dist/worker/WASQLiteDB.umd.js +182 -1931
  17. package/dist/worker/WASQLiteDB.umd.js.map +1 -1
  18. package/dist/worker/node_modules_bson_lib_bson_mjs.umd.js +3 -3
  19. package/dist/worker/node_modules_bson_lib_bson_mjs.umd.js.map +1 -1
  20. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite-async_mjs.umd.js +22 -9
  21. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite-async_mjs.umd.js.map +1 -1
  22. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite_mjs.umd.js +22 -9
  23. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_mc-wa-sqlite_mjs.umd.js.map +1 -1
  24. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js +22 -9
  25. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite-async_mjs.umd.js.map +1 -1
  26. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js +22 -9
  27. package/dist/worker/node_modules_journeyapps_wa-sqlite_dist_wa-sqlite_mjs.umd.js.map +1 -1
  28. package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js.umd.js +1206 -3
  29. package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js.umd.js.map +1 -1
  30. package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.umd.js +1209 -6
  31. package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_IDBBatchAtomicVFS_js.umd.js.map +1 -1
  32. package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js.umd.js +1820 -0
  33. package/dist/worker/node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js.umd.js.map +1 -0
  34. package/lib/package.json +20 -15
  35. package/lib/src/db/PowerSyncDatabase.d.ts +3 -1
  36. package/lib/src/db/PowerSyncDatabase.js +19 -7
  37. package/lib/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.d.ts +1 -1
  38. package/lib/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.js +1 -1
  39. package/lib/src/db/adapters/AbstractWebSQLOpenFactory.d.ts +2 -2
  40. package/lib/src/db/adapters/AbstractWebSQLOpenFactory.js +2 -2
  41. package/lib/src/db/adapters/AsyncDatabaseConnection.d.ts +1 -9
  42. package/lib/src/db/adapters/AsyncDatabaseConnection.js +1 -11
  43. package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.d.ts +3 -3
  44. package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.js +25 -12
  45. package/lib/src/db/adapters/WebDBAdapter.d.ts +1 -1
  46. package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.d.ts +2 -2
  47. package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js +1 -2
  48. package/lib/src/db/adapters/wa-sqlite/WASQLiteConnection.d.ts +2 -2
  49. package/lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js +12 -3
  50. package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.d.ts +3 -3
  51. package/lib/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.js +5 -5
  52. package/lib/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.d.ts +4 -4
  53. package/lib/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.js +6 -6
  54. package/lib/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.d.ts +1 -1
  55. package/lib/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.js +3 -3
  56. package/lib/src/db/sync/SharedWebStreamingSyncImplementation.d.ts +4 -4
  57. package/lib/src/db/sync/SharedWebStreamingSyncImplementation.js +5 -5
  58. package/lib/src/db/sync/WebRemote.js +1 -1
  59. package/lib/src/db/sync/WebStreamingSyncImplementation.d.ts +1 -1
  60. package/lib/src/db/sync/WebStreamingSyncImplementation.js +1 -1
  61. package/lib/src/index.d.ts +12 -12
  62. package/lib/src/index.js +12 -12
  63. package/lib/src/worker/db/SharedWASQLiteConnection.d.ts +2 -2
  64. package/lib/src/worker/db/WASQLiteDB.worker.js +4 -3
  65. package/lib/src/worker/db/WorkerWASQLiteConnection.d.ts +2 -2
  66. package/lib/src/worker/db/WorkerWASQLiteConnection.js +1 -1
  67. package/lib/src/worker/db/open-worker-database.d.ts +2 -2
  68. package/lib/src/worker/db/open-worker-database.js +1 -1
  69. package/lib/src/worker/sync/BroadcastLogger.d.ts +1 -1
  70. package/lib/src/worker/sync/SharedSyncImplementation.d.ts +4 -4
  71. package/lib/src/worker/sync/SharedSyncImplementation.js +84 -83
  72. package/lib/src/worker/sync/SharedSyncImplementation.worker.js +2 -2
  73. package/lib/src/worker/sync/WorkerClient.d.ts +1 -1
  74. package/lib/src/worker/sync/WorkerClient.js +2 -2
  75. package/lib/tsconfig.tsbuildinfo +1 -1
  76. package/package.json +21 -16
  77. package/src/db/PowerSyncDatabase.ts +23 -8
  78. package/src/db/adapters/AbstractWebPowerSyncDatabaseOpenFactory.ts +1 -1
  79. package/src/db/adapters/AbstractWebSQLOpenFactory.ts +3 -3
  80. package/src/db/adapters/AsyncDatabaseConnection.ts +1 -13
  81. package/src/db/adapters/LockedAsyncDatabaseAdapter.ts +30 -14
  82. package/src/db/adapters/WebDBAdapter.ts +1 -1
  83. package/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.ts +3 -4
  84. package/src/db/adapters/wa-sqlite/WASQLiteConnection.ts +14 -5
  85. package/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.ts +7 -7
  86. package/src/db/adapters/wa-sqlite/WASQLiteOpenFactory.ts +7 -7
  87. package/src/db/adapters/wa-sqlite/WASQLitePowerSyncDatabaseOpenFactory.ts +3 -3
  88. package/src/db/sync/SharedWebStreamingSyncImplementation.ts +7 -7
  89. package/src/db/sync/WebRemote.ts +1 -1
  90. package/src/db/sync/WebStreamingSyncImplementation.ts +2 -2
  91. package/src/index.ts +12 -12
  92. package/src/worker/db/SharedWASQLiteConnection.ts +2 -2
  93. package/src/worker/db/WASQLiteDB.worker.ts +6 -5
  94. package/src/worker/db/WorkerWASQLiteConnection.ts +2 -2
  95. package/src/worker/db/open-worker-database.ts +2 -2
  96. package/src/worker/sync/BroadcastLogger.ts +1 -1
  97. package/src/worker/sync/SharedSyncImplementation.ts +92 -89
  98. package/src/worker/sync/SharedSyncImplementation.worker.ts +2 -2
  99. package/src/worker/sync/WorkerClient.ts +2 -2
  100. package/dist/1807036ae51c10ee4d23.wasm +0 -0
  101. package/dist/307d8ce2280e3bae09d5.wasm +0 -0
  102. package/dist/cd8b9e8f4c87bf81c169.wasm +0 -0
  103. package/dist/e797080f5ed0b5324166.wasm +0 -0
  104. package/lib/src/worker/db/opfs.d.ts +0 -96
  105. package/lib/src/worker/db/opfs.js +0 -582
  106. package/src/worker/db/opfs.ts +0 -623
  107. /package/bin/{powersync.js → powersync.cjs} +0 -0
@@ -3,1214 +3,11 @@ var sdk_web;
3
3
  /******/ "use strict";
4
4
  /******/ var __webpack_modules__ = ({
5
5
 
6
- /***/ "../../node_modules/@journeyapps/wa-sqlite/src/FacadeVFS.js":
7
- /*!******************************************************************!*\
8
- !*** ../../node_modules/@journeyapps/wa-sqlite/src/FacadeVFS.js ***!
9
- \******************************************************************/
10
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11
-
12
- __webpack_require__.r(__webpack_exports__);
13
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14
- /* harmony export */ FacadeVFS: () => (/* binding */ FacadeVFS)
15
- /* harmony export */ });
16
- /* harmony import */ var _VFS_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./VFS.js */ "../../node_modules/@journeyapps/wa-sqlite/src/VFS.js");
17
- // Copyright 2024 Roy T. Hashimoto. All Rights Reserved.
18
-
19
-
20
- const AsyncFunction = Object.getPrototypeOf(async function(){}).constructor;
21
-
22
- // Milliseconds since Julian epoch as a BigInt.
23
- // https://github.com/sqlite/sqlite/blob/e57527c14f7b7cfa6e32eeab5c549d50c4fa3674/src/os_unix.c#L6872-L6882
24
- const UNIX_EPOCH = 24405875n * 8640000n;
25
-
26
- // Convenience base class for a JavaScript VFS.
27
- // The raw xOpen, xRead, etc. function signatures receive only C primitives
28
- // which aren't easy to work with. This class provides corresponding calls
29
- // like jOpen, jRead, etc., which receive JavaScript-friendlier arguments
30
- // such as string, Uint8Array, and DataView.
31
- class FacadeVFS extends _VFS_js__WEBPACK_IMPORTED_MODULE_0__.Base {
32
- /**
33
- * @param {string} name
34
- * @param {object} module
35
- */
36
- constructor(name, module) {
37
- super(name, module);
38
- }
39
-
40
- /**
41
- * Override to indicate which methods are asynchronous.
42
- * @param {string} methodName
43
- * @returns {boolean}
44
- */
45
- hasAsyncMethod(methodName) {
46
- // The input argument is a string like "xOpen", so convert to "jOpen".
47
- // Then check if the method exists and is async.
48
- const jMethodName = `j${methodName.slice(1)}`;
49
- return this[jMethodName] instanceof AsyncFunction;
50
- }
51
-
52
- /**
53
- * Return the filename for a file id for use by mixins.
54
- * @param {number} pFile
55
- * @returns {string}
56
- */
57
- getFilename(pFile) {
58
- throw new Error('unimplemented');
59
- }
60
-
61
- /**
62
- * @param {string?} filename
63
- * @param {number} pFile
64
- * @param {number} flags
65
- * @param {DataView} pOutFlags
66
- * @returns {number|Promise<number>}
67
- */
68
- jOpen(filename, pFile, flags, pOutFlags) {
69
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CANTOPEN;
70
- }
71
-
72
- /**
73
- * @param {string} filename
74
- * @param {number} syncDir
75
- * @returns {number|Promise<number>}
76
- */
77
- jDelete(filename, syncDir) {
78
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
79
- }
80
-
81
- /**
82
- * @param {string} filename
83
- * @param {number} flags
84
- * @param {DataView} pResOut
85
- * @returns {number|Promise<number>}
86
- */
87
- jAccess(filename, flags, pResOut) {
88
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
89
- }
90
-
91
- /**
92
- * @param {string} filename
93
- * @param {Uint8Array} zOut
94
- * @returns {number|Promise<number>}
95
- */
96
- jFullPathname(filename, zOut) {
97
- // Copy the filename to the output buffer.
98
- const { read, written } = new TextEncoder().encodeInto(filename, zOut);
99
- if (read < filename.length) return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR;
100
- if (written >= zOut.length) return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR;
101
- zOut[written] = 0;
102
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
103
- }
104
-
105
- /**
106
- * @param {Uint8Array} zBuf
107
- * @returns {number|Promise<number>}
108
- */
109
- jGetLastError(zBuf) {
110
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
111
- }
112
-
113
- /**
114
- * @param {number} pFile
115
- * @returns {number|Promise<number>}
116
- */
117
- jClose(pFile) {
118
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
119
- }
120
-
121
- /**
122
- * @param {number} pFile
123
- * @param {Uint8Array} pData
124
- * @param {number} iOffset
125
- * @returns {number|Promise<number>}
126
- */
127
- jRead(pFile, pData, iOffset) {
128
- pData.fill(0);
129
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_SHORT_READ;
130
- }
131
-
132
- /**
133
- * @param {number} pFile
134
- * @param {Uint8Array} pData
135
- * @param {number} iOffset
136
- * @returns {number|Promise<number>}
137
- */
138
- jWrite(pFile, pData, iOffset) {
139
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_WRITE;
140
- }
141
-
142
- /**
143
- * @param {number} pFile
144
- * @param {number} size
145
- * @returns {number|Promise<number>}
146
- */
147
- jTruncate(pFile, size) {
148
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
149
- }
150
-
151
- /**
152
- * @param {number} pFile
153
- * @param {number} flags
154
- * @returns {number|Promise<number>}
155
- */
156
- jSync(pFile, flags) {
157
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
158
- }
159
-
160
- /**
161
- * @param {number} pFile
162
- * @param {DataView} pSize
163
- * @returns {number|Promise<number>}
164
- */
165
- jFileSize(pFile, pSize) {
166
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
167
- }
168
-
169
- /**
170
- * @param {number} pFile
171
- * @param {number} lockType
172
- * @returns {number|Promise<number>}
173
- */
174
- jLock(pFile, lockType) {
175
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
176
- }
177
-
178
- /**
179
- * @param {number} pFile
180
- * @param {number} lockType
181
- * @returns {number|Promise<number>}
182
- */
183
- jUnlock(pFile, lockType) {
184
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
185
- }
186
-
187
- /**
188
- * @param {number} pFile
189
- * @param {DataView} pResOut
190
- * @returns {number|Promise<number>}
191
- */
192
- jCheckReservedLock(pFile, pResOut) {
193
- pResOut.setInt32(0, 0, true);
194
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
195
- }
196
-
197
- /**
198
- * @param {number} pFile
199
- * @param {number} op
200
- * @param {DataView} pArg
201
- * @returns {number|Promise<number>}
202
- */
203
- jFileControl(pFile, op, pArg) {
204
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_NOTFOUND;
205
- }
206
-
207
- /**
208
- * @param {number} pFile
209
- * @returns {number|Promise<number>}
210
- */
211
- jSectorSize(pFile) {
212
- return super.xSectorSize(pFile);
213
- }
214
-
215
- /**
216
- * @param {number} pFile
217
- * @returns {number|Promise<number>}
218
- */
219
- jDeviceCharacteristics(pFile) {
220
- return 0;
221
- }
222
-
223
- /**
224
- * @param {number} pVfs
225
- * @param {number} zName
226
- * @param {number} pFile
227
- * @param {number} flags
228
- * @param {number} pOutFlags
229
- * @returns {number|Promise<number>}
230
- */
231
- xOpen(pVfs, zName, pFile, flags, pOutFlags) {
232
- const filename = this.#decodeFilename(zName, flags);
233
- const pOutFlagsView = this.#makeTypedDataView('Int32', pOutFlags);
234
- this['log']?.('jOpen', filename, pFile, '0x' + flags.toString(16));
235
- return this.jOpen(filename, pFile, flags, pOutFlagsView);
236
- }
237
-
238
- /**
239
- * @param {number} pVfs
240
- * @param {number} nByte
241
- * @param {number} pCharOut
242
- * @returns {number|Promise<number>}
243
- */
244
- xRandomness(pVfs, nByte, pCharOut) {
245
- const randomArray = new Uint8Array(nByte);
246
- crypto.getRandomValues(randomArray);
247
- // Copy randomArray to the WebAssembly memory
248
- const buffer = pCharOut; // Pointer to memory in WebAssembly
249
- this._module.HEAPU8.set(randomArray, buffer); // Copy randomArray into memory starting at buffer
250
- return nByte;
251
- }
252
-
253
- /**
254
- * Gets the current time as milliseconds since Unix epoch
255
- * @param {number} pVfs pointer to the VFS
256
- * @param {number} pTime pointer to write the time value
257
- * @returns {number} SQLite error code
258
- */
259
- xCurrentTimeInt64(pVfs, pTime) {
260
- // Create a DataView to write the current time
261
- const timeView = this.#makeTypedDataView('BigInt64', pTime);
262
-
263
- const currentTime = BigInt(Date.now());
264
- // Convert the current time to milliseconds since Unix epoch
265
- const value = UNIX_EPOCH + currentTime;
266
-
267
- // Write the time value to the pointer location
268
- timeView.setBigInt64(0, value, true);
269
-
270
- return _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
271
- }
272
-
273
- /**
274
- * @param {number} pVfs
275
- * @param {number} zName
276
- * @param {number} syncDir
277
- * @returns {number|Promise<number>}
278
- */
279
- xDelete(pVfs, zName, syncDir) {
280
- const filename = this._module.UTF8ToString(zName);
281
- this['log']?.('jDelete', filename, syncDir);
282
- return this.jDelete(filename, syncDir);
283
- }
284
-
285
- /**
286
- * @param {number} pVfs
287
- * @param {number} zName
288
- * @param {number} flags
289
- * @param {number} pResOut
290
- * @returns {number|Promise<number>}
291
- */
292
- xAccess(pVfs, zName, flags, pResOut) {
293
- const filename = this._module.UTF8ToString(zName);
294
- const pResOutView = this.#makeTypedDataView('Int32', pResOut);
295
- this['log']?.('jAccess', filename, flags);
296
- return this.jAccess(filename, flags, pResOutView);
297
- }
298
-
299
- /**
300
- * @param {number} pVfs
301
- * @param {number} zName
302
- * @param {number} nOut
303
- * @param {number} zOut
304
- * @returns {number|Promise<number>}
305
- */
306
- xFullPathname(pVfs, zName, nOut, zOut) {
307
- const filename = this._module.UTF8ToString(zName);
308
- const zOutArray = this._module.HEAPU8.subarray(zOut, zOut + nOut);
309
- this['log']?.('jFullPathname', filename, nOut);
310
- return this.jFullPathname(filename, zOutArray);
311
- }
312
-
313
- /**
314
- * @param {number} pVfs
315
- * @param {number} nBuf
316
- * @param {number} zBuf
317
- * @returns {number|Promise<number>}
318
- */
319
- xGetLastError(pVfs, nBuf, zBuf) {
320
- const zBufArray = this._module.HEAPU8.subarray(zBuf, zBuf + nBuf);
321
- this['log']?.('jGetLastError', nBuf);
322
- return this.jGetLastError(zBufArray);
323
- }
324
-
325
- /**
326
- * @param {number} pFile
327
- * @returns {number|Promise<number>}
328
- */
329
- xClose(pFile) {
330
- this['log']?.('jClose', pFile);
331
- return this.jClose(pFile);
332
- }
333
-
334
- /**
335
- * @param {number} pFile
336
- * @param {number} pData
337
- * @param {number} iAmt
338
- * @param {number} iOffsetLo
339
- * @param {number} iOffsetHi
340
- * @returns {number|Promise<number>}
341
- */
342
- xRead(pFile, pData, iAmt, iOffsetLo, iOffsetHi) {
343
- const pDataArray = this.#makeDataArray(pData, iAmt);
344
- const iOffset = delegalize(iOffsetLo, iOffsetHi);
345
- this['log']?.('jRead', pFile, iAmt, iOffset);
346
- return this.jRead(pFile, pDataArray, iOffset);
347
- }
348
-
349
- /**
350
- * @param {number} pFile
351
- * @param {number} pData
352
- * @param {number} iAmt
353
- * @param {number} iOffsetLo
354
- * @param {number} iOffsetHi
355
- * @returns {number|Promise<number>}
356
- */
357
- xWrite(pFile, pData, iAmt, iOffsetLo, iOffsetHi) {
358
- const pDataArray = this.#makeDataArray(pData, iAmt);
359
- const iOffset = delegalize(iOffsetLo, iOffsetHi);
360
- this['log']?.('jWrite', pFile, pDataArray, iOffset);
361
- return this.jWrite(pFile, pDataArray, iOffset);
362
- }
363
-
364
- /**
365
- * @param {number} pFile
366
- * @param {number} sizeLo
367
- * @param {number} sizeHi
368
- * @returns {number|Promise<number>}
369
- */
370
- xTruncate(pFile, sizeLo, sizeHi) {
371
- const size = delegalize(sizeLo, sizeHi);
372
- this['log']?.('jTruncate', pFile, size);
373
- return this.jTruncate(pFile, size);
374
- }
375
-
376
- /**
377
- * @param {number} pFile
378
- * @param {number} flags
379
- * @returns {number|Promise<number>}
380
- */
381
- xSync(pFile, flags) {
382
- this['log']?.('jSync', pFile, flags);
383
- return this.jSync(pFile, flags);
384
- }
385
-
386
- /**
387
- *
388
- * @param {number} pFile
389
- * @param {number} pSize
390
- * @returns {number|Promise<number>}
391
- */
392
- xFileSize(pFile, pSize) {
393
- const pSizeView = this.#makeTypedDataView('BigInt64', pSize);
394
- this['log']?.('jFileSize', pFile);
395
- return this.jFileSize(pFile, pSizeView);
396
- }
397
-
398
- /**
399
- * @param {number} pFile
400
- * @param {number} lockType
401
- * @returns {number|Promise<number>}
402
- */
403
- xLock(pFile, lockType) {
404
- this['log']?.('jLock', pFile, lockType);
405
- return this.jLock(pFile, lockType);
406
- }
407
-
408
- /**
409
- * @param {number} pFile
410
- * @param {number} lockType
411
- * @returns {number|Promise<number>}
412
- */
413
- xUnlock(pFile, lockType) {
414
- this['log']?.('jUnlock', pFile, lockType);
415
- return this.jUnlock(pFile, lockType);
416
- }
417
-
418
- /**
419
- * @param {number} pFile
420
- * @param {number} pResOut
421
- * @returns {number|Promise<number>}
422
- */
423
- xCheckReservedLock(pFile, pResOut) {
424
- const pResOutView = this.#makeTypedDataView('Int32', pResOut);
425
- this['log']?.('jCheckReservedLock', pFile);
426
- return this.jCheckReservedLock(pFile, pResOutView);
427
- }
428
-
429
- /**
430
- * @param {number} pFile
431
- * @param {number} op
432
- * @param {number} pArg
433
- * @returns {number|Promise<number>}
434
- */
435
- xFileControl(pFile, op, pArg) {
436
- const pArgView = new DataView(
437
- this._module.HEAPU8.buffer,
438
- this._module.HEAPU8.byteOffset + pArg);
439
- this['log']?.('jFileControl', pFile, op, pArgView);
440
- return this.jFileControl(pFile, op, pArgView);
441
- }
442
-
443
- /**
444
- * @param {number} pFile
445
- * @returns {number|Promise<number>}
446
- */
447
- xSectorSize(pFile) {
448
- this['log']?.('jSectorSize', pFile);
449
- return this.jSectorSize(pFile);
450
- }
451
-
452
- /**
453
- * @param {number} pFile
454
- * @returns {number|Promise<number>}
455
- */
456
- xDeviceCharacteristics(pFile) {
457
- this['log']?.('jDeviceCharacteristics', pFile);
458
- return this.jDeviceCharacteristics(pFile);
459
- }
460
-
461
- /**
462
- * Wrapped DataView for pointer arguments.
463
- * Pointers to a single value are passed using a DataView-like class.
464
- * This wrapper class prevents use of incorrect type or endianness, and
465
- * reacquires the underlying buffer when the WebAssembly memory is resized.
466
- * @param {'Int32'|'BigInt64'} type
467
- * @param {number} byteOffset
468
- * @returns {DataView}
469
- */
470
- #makeTypedDataView(type, byteOffset) {
471
- // @ts-ignore
472
- return new DataViewProxy(this._module, byteOffset, type);
473
- }
474
-
475
- /**
476
- * Wrapped Uint8Array for buffer arguments.
477
- * Memory blocks are passed as a Uint8Array-like class. This wrapper
478
- * class reacquires the underlying buffer when the WebAssembly memory
479
- * is resized.
480
- * @param {number} byteOffset
481
- * @param {number} byteLength
482
- * @returns {Uint8Array}
483
- */
484
- #makeDataArray(byteOffset, byteLength) {
485
- // @ts-ignore
486
- return new Uint8ArrayProxy(this._module, byteOffset, byteLength);
487
- }
488
-
489
- #decodeFilename(zName, flags) {
490
- if (flags & _VFS_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_URI) {
491
- // The first null-terminated string is the URI path. Subsequent
492
- // strings are query parameter keys and values.
493
- // https://www.sqlite.org/c3ref/open.html#urifilenamesinsqlite3open
494
- let pName = zName;
495
- let state = 1;
496
- const charCodes = [];
497
- while (state) {
498
- const charCode = this._module.HEAPU8[pName++];
499
- if (charCode) {
500
- charCodes.push(charCode);
501
- } else {
502
- if (!this._module.HEAPU8[pName]) state = null;
503
- switch (state) {
504
- case 1: // path
505
- charCodes.push('?'.charCodeAt(0));
506
- state = 2;
507
- break;
508
- case 2: // key
509
- charCodes.push('='.charCodeAt(0));
510
- state = 3;
511
- break;
512
- case 3: // value
513
- charCodes.push('&'.charCodeAt(0));
514
- state = 2;
515
- break;
516
- }
517
- }
518
- }
519
- return new TextDecoder().decode(new Uint8Array(charCodes));
520
- }
521
- return zName ? this._module.UTF8ToString(zName) : null;
522
- }
523
- }
524
-
525
- // Emscripten "legalizes" 64-bit integer arguments by passing them as
526
- // two 32-bit signed integers.
527
- function delegalize(lo32, hi32) {
528
- return (hi32 * 0x100000000) + lo32 + (lo32 < 0 ? 2**32 : 0);
529
- }
530
-
531
- // This class provides a Uint8Array-like interface for a WebAssembly memory
532
- // buffer. It is used to access memory blocks passed as arguments to
533
- // xRead, xWrite, etc. The class reacquires the underlying buffer when the
534
- // WebAssembly memory is resized, which can happen when the memory is
535
- // detached and resized by the WebAssembly module.
536
- //
537
- // Note that although this class implements the same methods as Uint8Array,
538
- // it is not a real Uint8Array and passing it to functions that expect
539
- // a Uint8Array may not work. Use subarray() to get a real Uint8Array
540
- // if needed.
541
- class Uint8ArrayProxy {
542
- #module;
543
-
544
- #_array = new Uint8Array()
545
- get #array() {
546
- if (this.#_array.buffer.byteLength === 0) {
547
- // WebAssembly memory resize detached the buffer so re-create the
548
- // array with the new buffer.
549
- this.#_array = this.#module.HEAPU8.subarray(
550
- this.byteOffset,
551
- this.byteOffset + this.byteLength);
552
- }
553
- return this.#_array;
554
- }
555
-
556
- /**
557
- * @param {*} module
558
- * @param {number} byteOffset
559
- * @param {number} byteLength
560
- */
561
- constructor(module, byteOffset, byteLength) {
562
- this.#module = module;
563
- this.byteOffset = byteOffset;
564
- this.length = this.byteLength = byteLength;
565
- }
566
-
567
- get buffer() {
568
- return this.#array.buffer;
569
- }
570
-
571
- at(index) {
572
- return this.#array.at(index);
573
- }
574
- copyWithin(target, start, end) {
575
- this.#array.copyWithin(target, start, end);
576
- }
577
- entries() {
578
- return this.#array.entries();
579
- }
580
- every(predicate) {
581
- return this.#array.every(predicate);
582
- }
583
- fill(value, start, end) {
584
- this.#array.fill(value, start, end);
585
- }
586
- filter(predicate) {
587
- return this.#array.filter(predicate);
588
- }
589
- find(predicate) {
590
- return this.#array.find(predicate);
591
- }
592
- findIndex(predicate) {
593
- return this.#array.findIndex(predicate);
594
- }
595
- findLast(predicate) {
596
- return this.#array.findLast(predicate);
597
- }
598
- findLastIndex(predicate) {
599
- return this.#array.findLastIndex(predicate);
600
- }
601
- forEach(callback) {
602
- this.#array.forEach(callback);
603
- }
604
- includes(value, start) {
605
- return this.#array.includes(value, start);
606
- }
607
- indexOf(value, start) {
608
- return this.#array.indexOf(value, start);
609
- }
610
- join(separator) {
611
- return this.#array.join(separator);
612
- }
613
- keys() {
614
- return this.#array.keys();
615
- }
616
- lastIndexOf(value, start) {
617
- return this.#array.lastIndexOf(value, start);
618
- }
619
- map(callback) {
620
- return this.#array.map(callback);
621
- }
622
- reduce(callback, initialValue) {
623
- return this.#array.reduce(callback, initialValue);
624
- }
625
- reduceRight(callback, initialValue) {
626
- return this.#array.reduceRight(callback, initialValue);
627
- }
628
- reverse() {
629
- this.#array.reverse();
630
- }
631
- set(array, offset) {
632
- this.#array.set(array, offset);
633
- }
634
- slice(start, end) {
635
- return this.#array.slice(start, end);
636
- }
637
- some(predicate) {
638
- return this.#array.some(predicate);
639
- }
640
- sort(compareFn) {
641
- this.#array.sort(compareFn);
642
- }
643
- subarray(begin, end) {
644
- return this.#array.subarray(begin, end);
645
- }
646
- toLocaleString(locales, options) {
647
- // @ts-ignore
648
- return this.#array.toLocaleString(locales, options);
649
- }
650
- toReversed() {
651
- return this.#array.toReversed();
652
- }
653
- toSorted(compareFn) {
654
- return this.#array.toSorted(compareFn);
655
- }
656
- toString() {
657
- return this.#array.toString();
658
- }
659
- values() {
660
- return this.#array.values();
661
- }
662
- with(index, value) {
663
- return this.#array.with(index, value);
664
- }
665
- [Symbol.iterator]() {
666
- return this.#array[Symbol.iterator]();
667
- }
668
- }
669
-
670
- // This class provides a DataView-like interface for a WebAssembly memory
671
- // buffer, restricted to either Int32 or BigInt64 types. It also reacquires
672
- // the underlying buffer when the WebAssembly memory is resized, which can
673
- // happen when the memory is detached and resized by the WebAssembly module.
674
- class DataViewProxy {
675
- #module;
676
- #type;
677
-
678
- #_view = new DataView(new ArrayBuffer(0));
679
- get #view() {
680
- if (this.#_view.buffer.byteLength === 0) {
681
- // WebAssembly memory resize detached the buffer so re-create the
682
- // view with the new buffer.
683
- this.#_view = new DataView(
684
- this.#module.HEAPU8.buffer,
685
- this.#module.HEAPU8.byteOffset + this.byteOffset);
686
- }
687
- return this.#_view;
688
- }
689
-
690
- /**
691
- * @param {*} module
692
- * @param {number} byteOffset
693
- * @param {'Int32'|'BigInt64'} type
694
- */
695
- constructor(module, byteOffset, type) {
696
- this.#module = module;
697
- this.byteOffset = byteOffset;
698
- this.#type = type;
699
- }
700
-
701
- get buffer() {
702
- return this.#view.buffer;
703
- }
704
- get byteLength() {
705
- return this.#type === 'Int32' ? 4 : 8;
706
- }
707
-
708
- getInt32(byteOffset, littleEndian) {
709
- if (this.#type !== 'Int32') {
710
- throw new Error('invalid type');
711
- }
712
- if (!littleEndian) throw new Error('must be little endian');
713
- return this.#view.getInt32(byteOffset, littleEndian);
714
- }
715
- setInt32(byteOffset, value, littleEndian) {
716
- if (this.#type !== 'Int32') {
717
- throw new Error('invalid type');
718
- }
719
- if (!littleEndian) throw new Error('must be little endian');
720
- this.#view.setInt32(byteOffset, value, littleEndian);
721
- }
722
- getBigInt64(byteOffset, littleEndian) {
723
- if (this.#type !== 'BigInt64') {
724
- throw new Error('invalid type');
725
- }
726
- if (!littleEndian) throw new Error('must be little endian');
727
- return this.#view.getBigInt64(byteOffset, littleEndian);
728
- }
729
- setBigInt64(byteOffset, value, littleEndian) {
730
- if (this.#type !== 'BigInt64') {
731
- throw new Error('invalid type');
732
- }
733
- if (!littleEndian) throw new Error('must be little endian');
734
- this.#view.setBigInt64(byteOffset, value, littleEndian);
735
- }
736
- }
737
-
738
- /***/ }),
739
-
740
- /***/ "../../node_modules/@journeyapps/wa-sqlite/src/VFS.js":
741
- /*!************************************************************!*\
742
- !*** ../../node_modules/@journeyapps/wa-sqlite/src/VFS.js ***!
743
- \************************************************************/
744
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
745
-
746
- __webpack_require__.r(__webpack_exports__);
747
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
748
- /* harmony export */ Base: () => (/* binding */ Base),
749
- /* harmony export */ FILE_TYPE_MASK: () => (/* binding */ FILE_TYPE_MASK),
750
- /* harmony export */ SQLITE_ABORT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_ABORT),
751
- /* harmony export */ SQLITE_ACCESS_EXISTS: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_ACCESS_EXISTS),
752
- /* harmony export */ SQLITE_ACCESS_READ: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_ACCESS_READ),
753
- /* harmony export */ SQLITE_ACCESS_READWRITE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_ACCESS_READWRITE),
754
- /* harmony export */ SQLITE_ALTER_TABLE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_ALTER_TABLE),
755
- /* harmony export */ SQLITE_ANALYZE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_ANALYZE),
756
- /* harmony export */ SQLITE_ATTACH: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_ATTACH),
757
- /* harmony export */ SQLITE_AUTH: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_AUTH),
758
- /* harmony export */ SQLITE_BLOB: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_BLOB),
759
- /* harmony export */ SQLITE_BUSY: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_BUSY),
760
- /* harmony export */ SQLITE_CANTOPEN: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CANTOPEN),
761
- /* harmony export */ SQLITE_CONSTRAINT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CONSTRAINT),
762
- /* harmony export */ SQLITE_CONSTRAINT_CHECK: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CONSTRAINT_CHECK),
763
- /* harmony export */ SQLITE_CONSTRAINT_COMMITHOOK: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CONSTRAINT_COMMITHOOK),
764
- /* harmony export */ SQLITE_CONSTRAINT_FOREIGNKEY: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CONSTRAINT_FOREIGNKEY),
765
- /* harmony export */ SQLITE_CONSTRAINT_FUNCTION: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CONSTRAINT_FUNCTION),
766
- /* harmony export */ SQLITE_CONSTRAINT_NOTNULL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CONSTRAINT_NOTNULL),
767
- /* harmony export */ SQLITE_CONSTRAINT_PINNED: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CONSTRAINT_PINNED),
768
- /* harmony export */ SQLITE_CONSTRAINT_PRIMARYKEY: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CONSTRAINT_PRIMARYKEY),
769
- /* harmony export */ SQLITE_CONSTRAINT_ROWID: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CONSTRAINT_ROWID),
770
- /* harmony export */ SQLITE_CONSTRAINT_TRIGGER: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CONSTRAINT_TRIGGER),
771
- /* harmony export */ SQLITE_CONSTRAINT_UNIQUE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CONSTRAINT_UNIQUE),
772
- /* harmony export */ SQLITE_CONSTRAINT_VTAB: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CONSTRAINT_VTAB),
773
- /* harmony export */ SQLITE_COPY: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_COPY),
774
- /* harmony export */ SQLITE_CORRUPT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CORRUPT),
775
- /* harmony export */ SQLITE_CREATE_INDEX: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CREATE_INDEX),
776
- /* harmony export */ SQLITE_CREATE_TABLE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CREATE_TABLE),
777
- /* harmony export */ SQLITE_CREATE_TEMP_INDEX: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CREATE_TEMP_INDEX),
778
- /* harmony export */ SQLITE_CREATE_TEMP_TABLE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CREATE_TEMP_TABLE),
779
- /* harmony export */ SQLITE_CREATE_TEMP_TRIGGER: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CREATE_TEMP_TRIGGER),
780
- /* harmony export */ SQLITE_CREATE_TEMP_VIEW: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CREATE_TEMP_VIEW),
781
- /* harmony export */ SQLITE_CREATE_TRIGGER: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CREATE_TRIGGER),
782
- /* harmony export */ SQLITE_CREATE_VIEW: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CREATE_VIEW),
783
- /* harmony export */ SQLITE_CREATE_VTABLE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CREATE_VTABLE),
784
- /* harmony export */ SQLITE_DELETE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DELETE),
785
- /* harmony export */ SQLITE_DENY: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DENY),
786
- /* harmony export */ SQLITE_DETACH: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DETACH),
787
- /* harmony export */ SQLITE_DETERMINISTIC: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DETERMINISTIC),
788
- /* harmony export */ SQLITE_DIRECTONLY: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DIRECTONLY),
789
- /* harmony export */ SQLITE_DONE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DONE),
790
- /* harmony export */ SQLITE_DROP_INDEX: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DROP_INDEX),
791
- /* harmony export */ SQLITE_DROP_TABLE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DROP_TABLE),
792
- /* harmony export */ SQLITE_DROP_TEMP_INDEX: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DROP_TEMP_INDEX),
793
- /* harmony export */ SQLITE_DROP_TEMP_TABLE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DROP_TEMP_TABLE),
794
- /* harmony export */ SQLITE_DROP_TEMP_TRIGGER: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DROP_TEMP_TRIGGER),
795
- /* harmony export */ SQLITE_DROP_TEMP_VIEW: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DROP_TEMP_VIEW),
796
- /* harmony export */ SQLITE_DROP_TRIGGER: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DROP_TRIGGER),
797
- /* harmony export */ SQLITE_DROP_VIEW: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DROP_VIEW),
798
- /* harmony export */ SQLITE_DROP_VTABLE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_DROP_VTABLE),
799
- /* harmony export */ SQLITE_EMPTY: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_EMPTY),
800
- /* harmony export */ SQLITE_ERROR: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_ERROR),
801
- /* harmony export */ SQLITE_FCNTL_BEGIN_ATOMIC_WRITE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_BEGIN_ATOMIC_WRITE),
802
- /* harmony export */ SQLITE_FCNTL_BUSYHANDLER: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_BUSYHANDLER),
803
- /* harmony export */ SQLITE_FCNTL_CHUNK_SIZE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_CHUNK_SIZE),
804
- /* harmony export */ SQLITE_FCNTL_CKPT_DONE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_CKPT_DONE),
805
- /* harmony export */ SQLITE_FCNTL_CKPT_START: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_CKPT_START),
806
- /* harmony export */ SQLITE_FCNTL_COMMIT_ATOMIC_WRITE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_COMMIT_ATOMIC_WRITE),
807
- /* harmony export */ SQLITE_FCNTL_COMMIT_PHASETWO: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_COMMIT_PHASETWO),
808
- /* harmony export */ SQLITE_FCNTL_DATA_VERSION: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_DATA_VERSION),
809
- /* harmony export */ SQLITE_FCNTL_FILE_POINTER: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_FILE_POINTER),
810
- /* harmony export */ SQLITE_FCNTL_GET_LOCKPROXYFILE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_GET_LOCKPROXYFILE),
811
- /* harmony export */ SQLITE_FCNTL_HAS_MOVED: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_HAS_MOVED),
812
- /* harmony export */ SQLITE_FCNTL_JOURNAL_POINTER: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_JOURNAL_POINTER),
813
- /* harmony export */ SQLITE_FCNTL_LAST_ERRNO: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_LAST_ERRNO),
814
- /* harmony export */ SQLITE_FCNTL_LOCKSTATE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_LOCKSTATE),
815
- /* harmony export */ SQLITE_FCNTL_LOCK_TIMEOUT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_LOCK_TIMEOUT),
816
- /* harmony export */ SQLITE_FCNTL_MMAP_SIZE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_MMAP_SIZE),
817
- /* harmony export */ SQLITE_FCNTL_OVERWRITE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_OVERWRITE),
818
- /* harmony export */ SQLITE_FCNTL_PDB: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_PDB),
819
- /* harmony export */ SQLITE_FCNTL_PERSIST_WAL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_PERSIST_WAL),
820
- /* harmony export */ SQLITE_FCNTL_POWERSAFE_OVERWRITE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_POWERSAFE_OVERWRITE),
821
- /* harmony export */ SQLITE_FCNTL_PRAGMA: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_PRAGMA),
822
- /* harmony export */ SQLITE_FCNTL_RBU: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_RBU),
823
- /* harmony export */ SQLITE_FCNTL_RESERVE_BYTES: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_RESERVE_BYTES),
824
- /* harmony export */ SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE),
825
- /* harmony export */ SQLITE_FCNTL_SET_LOCKPROXYFILE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_SET_LOCKPROXYFILE),
826
- /* harmony export */ SQLITE_FCNTL_SIZE_HINT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_SIZE_HINT),
827
- /* harmony export */ SQLITE_FCNTL_SIZE_LIMIT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_SIZE_LIMIT),
828
- /* harmony export */ SQLITE_FCNTL_SYNC: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_SYNC),
829
- /* harmony export */ SQLITE_FCNTL_SYNC_OMITTED: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_SYNC_OMITTED),
830
- /* harmony export */ SQLITE_FCNTL_TEMPFILENAME: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_TEMPFILENAME),
831
- /* harmony export */ SQLITE_FCNTL_TRACE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_TRACE),
832
- /* harmony export */ SQLITE_FCNTL_VFSNAME: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_VFSNAME),
833
- /* harmony export */ SQLITE_FCNTL_VFS_POINTER: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_VFS_POINTER),
834
- /* harmony export */ SQLITE_FCNTL_WAL_BLOCK: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_WAL_BLOCK),
835
- /* harmony export */ SQLITE_FCNTL_WIN32_AV_RETRY: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_WIN32_AV_RETRY),
836
- /* harmony export */ SQLITE_FCNTL_WIN32_GET_HANDLE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_WIN32_GET_HANDLE),
837
- /* harmony export */ SQLITE_FCNTL_WIN32_SET_HANDLE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_WIN32_SET_HANDLE),
838
- /* harmony export */ SQLITE_FCNTL_ZIPVFS: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FCNTL_ZIPVFS),
839
- /* harmony export */ SQLITE_FLOAT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FLOAT),
840
- /* harmony export */ SQLITE_FORMAT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FORMAT),
841
- /* harmony export */ SQLITE_FULL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FULL),
842
- /* harmony export */ SQLITE_FUNCTION: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_FUNCTION),
843
- /* harmony export */ SQLITE_IGNORE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IGNORE),
844
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_EQ: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_EQ),
845
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_FUNCTION: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_FUNCTION),
846
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_GE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_GE),
847
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_GLOB: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_GLOB),
848
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_GT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_GT),
849
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_IS: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_IS),
850
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_ISNOT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_ISNOT),
851
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_ISNOTNULL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_ISNOTNULL),
852
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_ISNULL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_ISNULL),
853
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_LE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_LE),
854
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_LIKE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_LIKE),
855
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_LT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_LT),
856
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_MATCH: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_MATCH),
857
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_NE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_NE),
858
- /* harmony export */ SQLITE_INDEX_CONSTRAINT_REGEXP: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_CONSTRAINT_REGEXP),
859
- /* harmony export */ SQLITE_INDEX_SCAN_UNIQUE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INDEX_SCAN_UNIQUE),
860
- /* harmony export */ SQLITE_INNOCUOUS: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INNOCUOUS),
861
- /* harmony export */ SQLITE_INSERT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INSERT),
862
- /* harmony export */ SQLITE_INTEGER: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INTEGER),
863
- /* harmony export */ SQLITE_INTERNAL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INTERNAL),
864
- /* harmony export */ SQLITE_INTERRUPT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_INTERRUPT),
865
- /* harmony export */ SQLITE_IOCAP_ATOMIC: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_ATOMIC),
866
- /* harmony export */ SQLITE_IOCAP_ATOMIC16K: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_ATOMIC16K),
867
- /* harmony export */ SQLITE_IOCAP_ATOMIC1K: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_ATOMIC1K),
868
- /* harmony export */ SQLITE_IOCAP_ATOMIC2K: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_ATOMIC2K),
869
- /* harmony export */ SQLITE_IOCAP_ATOMIC32K: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_ATOMIC32K),
870
- /* harmony export */ SQLITE_IOCAP_ATOMIC4K: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_ATOMIC4K),
871
- /* harmony export */ SQLITE_IOCAP_ATOMIC512: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_ATOMIC512),
872
- /* harmony export */ SQLITE_IOCAP_ATOMIC64K: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_ATOMIC64K),
873
- /* harmony export */ SQLITE_IOCAP_ATOMIC8K: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_ATOMIC8K),
874
- /* harmony export */ SQLITE_IOCAP_BATCH_ATOMIC: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_BATCH_ATOMIC),
875
- /* harmony export */ SQLITE_IOCAP_IMMUTABLE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_IMMUTABLE),
876
- /* harmony export */ SQLITE_IOCAP_POWERSAFE_OVERWRITE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_POWERSAFE_OVERWRITE),
877
- /* harmony export */ SQLITE_IOCAP_SAFE_APPEND: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_SAFE_APPEND),
878
- /* harmony export */ SQLITE_IOCAP_SEQUENTIAL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_SEQUENTIAL),
879
- /* harmony export */ SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN),
880
- /* harmony export */ SQLITE_IOERR: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR),
881
- /* harmony export */ SQLITE_IOERR_ACCESS: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_ACCESS),
882
- /* harmony export */ SQLITE_IOERR_BEGIN_ATOMIC: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_BEGIN_ATOMIC),
883
- /* harmony export */ SQLITE_IOERR_CHECKRESERVEDLOCK: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_CHECKRESERVEDLOCK),
884
- /* harmony export */ SQLITE_IOERR_CLOSE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_CLOSE),
885
- /* harmony export */ SQLITE_IOERR_COMMIT_ATOMIC: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_COMMIT_ATOMIC),
886
- /* harmony export */ SQLITE_IOERR_DATA: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_DATA),
887
- /* harmony export */ SQLITE_IOERR_DELETE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_DELETE),
888
- /* harmony export */ SQLITE_IOERR_DELETE_NOENT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_DELETE_NOENT),
889
- /* harmony export */ SQLITE_IOERR_DIR_FSYNC: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_DIR_FSYNC),
890
- /* harmony export */ SQLITE_IOERR_FSTAT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_FSTAT),
891
- /* harmony export */ SQLITE_IOERR_FSYNC: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_FSYNC),
892
- /* harmony export */ SQLITE_IOERR_GETTEMPPATH: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_GETTEMPPATH),
893
- /* harmony export */ SQLITE_IOERR_LOCK: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_LOCK),
894
- /* harmony export */ SQLITE_IOERR_NOMEM: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_NOMEM),
895
- /* harmony export */ SQLITE_IOERR_RDLOCK: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_RDLOCK),
896
- /* harmony export */ SQLITE_IOERR_READ: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_READ),
897
- /* harmony export */ SQLITE_IOERR_ROLLBACK_ATOMIC: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_ROLLBACK_ATOMIC),
898
- /* harmony export */ SQLITE_IOERR_SEEK: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_SEEK),
899
- /* harmony export */ SQLITE_IOERR_SHORT_READ: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_SHORT_READ),
900
- /* harmony export */ SQLITE_IOERR_TRUNCATE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_TRUNCATE),
901
- /* harmony export */ SQLITE_IOERR_UNLOCK: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_UNLOCK),
902
- /* harmony export */ SQLITE_IOERR_VNODE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_VNODE),
903
- /* harmony export */ SQLITE_IOERR_WRITE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_IOERR_WRITE),
904
- /* harmony export */ SQLITE_LIMIT_ATTACHED: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LIMIT_ATTACHED),
905
- /* harmony export */ SQLITE_LIMIT_COLUMN: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LIMIT_COLUMN),
906
- /* harmony export */ SQLITE_LIMIT_COMPOUND_SELECT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LIMIT_COMPOUND_SELECT),
907
- /* harmony export */ SQLITE_LIMIT_EXPR_DEPTH: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LIMIT_EXPR_DEPTH),
908
- /* harmony export */ SQLITE_LIMIT_FUNCTION_ARG: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LIMIT_FUNCTION_ARG),
909
- /* harmony export */ SQLITE_LIMIT_LENGTH: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LIMIT_LENGTH),
910
- /* harmony export */ SQLITE_LIMIT_LIKE_PATTERN_LENGTH: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LIMIT_LIKE_PATTERN_LENGTH),
911
- /* harmony export */ SQLITE_LIMIT_SQL_LENGTH: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LIMIT_SQL_LENGTH),
912
- /* harmony export */ SQLITE_LIMIT_TRIGGER_DEPTH: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LIMIT_TRIGGER_DEPTH),
913
- /* harmony export */ SQLITE_LIMIT_VARIABLE_NUMBER: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LIMIT_VARIABLE_NUMBER),
914
- /* harmony export */ SQLITE_LIMIT_VDBE_OP: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LIMIT_VDBE_OP),
915
- /* harmony export */ SQLITE_LIMIT_WORKER_THREADS: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LIMIT_WORKER_THREADS),
916
- /* harmony export */ SQLITE_LOCKED: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LOCKED),
917
- /* harmony export */ SQLITE_LOCK_EXCLUSIVE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LOCK_EXCLUSIVE),
918
- /* harmony export */ SQLITE_LOCK_NONE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LOCK_NONE),
919
- /* harmony export */ SQLITE_LOCK_PENDING: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LOCK_PENDING),
920
- /* harmony export */ SQLITE_LOCK_RESERVED: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LOCK_RESERVED),
921
- /* harmony export */ SQLITE_LOCK_SHARED: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_LOCK_SHARED),
922
- /* harmony export */ SQLITE_MISMATCH: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_MISMATCH),
923
- /* harmony export */ SQLITE_MISUSE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_MISUSE),
924
- /* harmony export */ SQLITE_NOLFS: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_NOLFS),
925
- /* harmony export */ SQLITE_NOMEM: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_NOMEM),
926
- /* harmony export */ SQLITE_NOTADB: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_NOTADB),
927
- /* harmony export */ SQLITE_NOTFOUND: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_NOTFOUND),
928
- /* harmony export */ SQLITE_NOTICE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_NOTICE),
929
- /* harmony export */ SQLITE_NULL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_NULL),
930
- /* harmony export */ SQLITE_OK: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK),
931
- /* harmony export */ SQLITE_OPEN_AUTOPROXY: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_AUTOPROXY),
932
- /* harmony export */ SQLITE_OPEN_CREATE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_CREATE),
933
- /* harmony export */ SQLITE_OPEN_DELETEONCLOSE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_DELETEONCLOSE),
934
- /* harmony export */ SQLITE_OPEN_EXCLUSIVE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_EXCLUSIVE),
935
- /* harmony export */ SQLITE_OPEN_FULLMUTEX: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_FULLMUTEX),
936
- /* harmony export */ SQLITE_OPEN_MAIN_DB: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_MAIN_DB),
937
- /* harmony export */ SQLITE_OPEN_MAIN_JOURNAL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_MAIN_JOURNAL),
938
- /* harmony export */ SQLITE_OPEN_MEMORY: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_MEMORY),
939
- /* harmony export */ SQLITE_OPEN_NOFOLLOW: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_NOFOLLOW),
940
- /* harmony export */ SQLITE_OPEN_NOMUTEX: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_NOMUTEX),
941
- /* harmony export */ SQLITE_OPEN_PRIVATECACHE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_PRIVATECACHE),
942
- /* harmony export */ SQLITE_OPEN_READONLY: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_READONLY),
943
- /* harmony export */ SQLITE_OPEN_READWRITE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_READWRITE),
944
- /* harmony export */ SQLITE_OPEN_SHAREDCACHE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_SHAREDCACHE),
945
- /* harmony export */ SQLITE_OPEN_SUBJOURNAL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_SUBJOURNAL),
946
- /* harmony export */ SQLITE_OPEN_SUPER_JOURNAL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_SUPER_JOURNAL),
947
- /* harmony export */ SQLITE_OPEN_TEMP_DB: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_TEMP_DB),
948
- /* harmony export */ SQLITE_OPEN_TEMP_JOURNAL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_TEMP_JOURNAL),
949
- /* harmony export */ SQLITE_OPEN_TRANSIENT_DB: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_TRANSIENT_DB),
950
- /* harmony export */ SQLITE_OPEN_URI: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_URI),
951
- /* harmony export */ SQLITE_OPEN_WAL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_WAL),
952
- /* harmony export */ SQLITE_PERM: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_PERM),
953
- /* harmony export */ SQLITE_PRAGMA: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_PRAGMA),
954
- /* harmony export */ SQLITE_PREPARE_NORMALIZED: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_PREPARE_NORMALIZED),
955
- /* harmony export */ SQLITE_PREPARE_NO_VTAB: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_PREPARE_NO_VTAB),
956
- /* harmony export */ SQLITE_PREPARE_PERSISTENT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_PREPARE_PERSISTENT),
957
- /* harmony export */ SQLITE_PROTOCOL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_PROTOCOL),
958
- /* harmony export */ SQLITE_RANGE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_RANGE),
959
- /* harmony export */ SQLITE_READ: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_READ),
960
- /* harmony export */ SQLITE_READONLY: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_READONLY),
961
- /* harmony export */ SQLITE_RECURSIVE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_RECURSIVE),
962
- /* harmony export */ SQLITE_REINDEX: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_REINDEX),
963
- /* harmony export */ SQLITE_ROW: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_ROW),
964
- /* harmony export */ SQLITE_SAVEPOINT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_SAVEPOINT),
965
- /* harmony export */ SQLITE_SCHEMA: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_SCHEMA),
966
- /* harmony export */ SQLITE_SELECT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_SELECT),
967
- /* harmony export */ SQLITE_STATIC: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_STATIC),
968
- /* harmony export */ SQLITE_SUBTYPE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_SUBTYPE),
969
- /* harmony export */ SQLITE_SYNC_DATAONLY: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_SYNC_DATAONLY),
970
- /* harmony export */ SQLITE_SYNC_FULL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_SYNC_FULL),
971
- /* harmony export */ SQLITE_SYNC_NORMAL: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_SYNC_NORMAL),
972
- /* harmony export */ SQLITE_TEXT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_TEXT),
973
- /* harmony export */ SQLITE_TOOBIG: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_TOOBIG),
974
- /* harmony export */ SQLITE_TRANSACTION: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_TRANSACTION),
975
- /* harmony export */ SQLITE_TRANSIENT: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_TRANSIENT),
976
- /* harmony export */ SQLITE_UPDATE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_UPDATE),
977
- /* harmony export */ SQLITE_UTF16: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_UTF16),
978
- /* harmony export */ SQLITE_UTF16BE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_UTF16BE),
979
- /* harmony export */ SQLITE_UTF16LE: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_UTF16LE),
980
- /* harmony export */ SQLITE_UTF8: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_UTF8),
981
- /* harmony export */ SQLITE_WARNING: () => (/* reexport safe */ _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_WARNING)
982
- /* harmony export */ });
983
- /* harmony import */ var _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sqlite-constants.js */ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-constants.js");
984
- // Copyright 2024 Roy T. Hashimoto. All Rights Reserved.
985
-
986
-
987
-
988
- const DEFAULT_SECTOR_SIZE = 512;
989
-
990
- // Base class for a VFS.
991
- class Base {
992
- name;
993
- mxPathname = 64;
994
- _module;
995
-
996
- /**
997
- * @param {string} name
998
- * @param {object} module
999
- */
1000
- constructor(name, module) {
1001
- this.name = name;
1002
- this._module = module;
1003
- }
1004
-
1005
- /**
1006
- * @returns {void|Promise<void>}
1007
- */
1008
- close() {
1009
- }
1010
-
1011
- /**
1012
- * @returns {boolean|Promise<boolean>}
1013
- */
1014
- isReady() {
1015
- return true;
1016
- }
1017
-
1018
- /**
1019
- * Overload in subclasses to indicate which methods are asynchronous.
1020
- * @param {string} methodName
1021
- * @returns {boolean}
1022
- */
1023
- hasAsyncMethod(methodName) {
1024
- return false;
1025
- }
1026
-
1027
- /**
1028
- * @param {number} pVfs
1029
- * @param {number} zName
1030
- * @param {number} pFile
1031
- * @param {number} flags
1032
- * @param {number} pOutFlags
1033
- * @returns {number|Promise<number>}
1034
- */
1035
- xOpen(pVfs, zName, pFile, flags, pOutFlags) {
1036
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_CANTOPEN;
1037
- }
1038
-
1039
- /**
1040
- * @param {number} pVfs
1041
- * @param {number} zName
1042
- * @param {number} syncDir
1043
- * @returns {number|Promise<number>}
1044
- */
1045
- xDelete(pVfs, zName, syncDir) {
1046
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
1047
- }
1048
-
1049
- /**
1050
- * @param {number} pVfs
1051
- * @param {number} zName
1052
- * @param {number} flags
1053
- * @param {number} pResOut
1054
- * @returns {number|Promise<number>}
1055
- */
1056
- xAccess(pVfs, zName, flags, pResOut) {
1057
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
1058
- }
1059
-
1060
- /**
1061
- * @param {number} pVfs
1062
- * @param {number} zName
1063
- * @param {number} nOut
1064
- * @param {number} zOut
1065
- * @returns {number|Promise<number>}
1066
- */
1067
- xFullPathname(pVfs, zName, nOut, zOut) {
1068
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
1069
- }
1070
-
1071
- /**
1072
- * @param {number} pVfs
1073
- * @param {number} nBuf
1074
- * @param {number} zBuf
1075
- * @returns {number|Promise<number>}
1076
- */
1077
- xGetLastError(pVfs, nBuf, zBuf) {
1078
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
1079
- }
1080
-
1081
- /**
1082
- * @param {number} pFile
1083
- * @returns {number|Promise<number>}
1084
- */
1085
- xClose(pFile) {
1086
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
1087
- }
1088
-
1089
- /**
1090
- * @param {number} pFile
1091
- * @param {number} pData
1092
- * @param {number} iAmt
1093
- * @param {number} iOffsetLo
1094
- * @param {number} iOffsetHi
1095
- * @returns {number|Promise<number>}
1096
- */
1097
- xRead(pFile, pData, iAmt, iOffsetLo, iOffsetHi) {
1098
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
1099
- }
1100
-
1101
- /**
1102
- * @param {number} pFile
1103
- * @param {number} pData
1104
- * @param {number} iAmt
1105
- * @param {number} iOffsetLo
1106
- * @param {number} iOffsetHi
1107
- * @returns {number|Promise<number>}
1108
- */
1109
- xWrite(pFile, pData, iAmt, iOffsetLo, iOffsetHi) {
1110
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
1111
- }
1112
-
1113
- /**
1114
- * @param {number} pFile
1115
- * @param {number} sizeLo
1116
- * @param {number} sizeHi
1117
- * @returns {number|Promise<number>}
1118
- */
1119
- xTruncate(pFile, sizeLo, sizeHi) {
1120
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
1121
- }
1122
-
1123
- /**
1124
- * @param {number} pFile
1125
- * @param {number} flags
1126
- * @returns {number|Promise<number>}
1127
- */
1128
- xSync(pFile, flags) {
1129
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
1130
- }
1131
-
1132
- /**
1133
- *
1134
- * @param {number} pFile
1135
- * @param {number} pSize
1136
- * @returns {number|Promise<number>}
1137
- */
1138
- xFileSize(pFile, pSize) {
1139
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
1140
- }
1141
-
1142
- /**
1143
- * @param {number} pFile
1144
- * @param {number} lockType
1145
- * @returns {number|Promise<number>}
1146
- */
1147
- xLock(pFile, lockType) {
1148
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
1149
- }
1150
-
1151
- /**
1152
- * @param {number} pFile
1153
- * @param {number} lockType
1154
- * @returns {number|Promise<number>}
1155
- */
1156
- xUnlock(pFile, lockType) {
1157
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
1158
- }
1159
-
1160
- /**
1161
- * @param {number} pFile
1162
- * @param {number} pResOut
1163
- * @returns {number|Promise<number>}
1164
- */
1165
- xCheckReservedLock(pFile, pResOut) {
1166
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OK;
1167
- }
1168
-
1169
- /**
1170
- * @param {number} pFile
1171
- * @param {number} op
1172
- * @param {number} pArg
1173
- * @returns {number|Promise<number>}
1174
- */
1175
- xFileControl(pFile, op, pArg) {
1176
- return _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_NOTFOUND;
1177
- }
1178
-
1179
- /**
1180
- * @param {number} pFile
1181
- * @returns {number|Promise<number>}
1182
- */
1183
- xSectorSize(pFile) {
1184
- return DEFAULT_SECTOR_SIZE;
1185
- }
1186
-
1187
- /**
1188
- * @param {number} pFile
1189
- * @returns {number|Promise<number>}
1190
- */
1191
- xDeviceCharacteristics(pFile) {
1192
- return 0;
1193
- }
1194
- }
1195
-
1196
- const FILE_TYPE_MASK = [
1197
- _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_MAIN_DB,
1198
- _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_MAIN_JOURNAL,
1199
- _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_TEMP_DB,
1200
- _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_TEMP_JOURNAL,
1201
- _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_TRANSIENT_DB,
1202
- _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_SUBJOURNAL,
1203
- _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_SUPER_JOURNAL,
1204
- _sqlite_constants_js__WEBPACK_IMPORTED_MODULE_0__.SQLITE_OPEN_WAL
1205
- ].reduce((mask, element) => mask | element);
1206
-
1207
- /***/ }),
1208
-
1209
- /***/ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js":
6
+ /***/ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js"
1210
7
  /*!*******************************************************************!*\
1211
8
  !*** ../../node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js ***!
1212
9
  \*******************************************************************/
1213
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
10
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1214
11
 
1215
12
  __webpack_require__.r(__webpack_exports__);
1216
13
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -2350,8 +1147,11 @@ function Factory(Module) {
2350
1147
  // Wait for all pending retry operations to complete. This is
2351
1148
  // normally empty on the first loop iteration.
2352
1149
  if (Module.retryOps.length) {
2353
- await Promise.all(Module.retryOps);
2354
- Module.retryOps = [];
1150
+ try {
1151
+ await Promise.all(Module.retryOps);
1152
+ } finally {
1153
+ Module.retryOps = [];
1154
+ }
2355
1155
  }
2356
1156
 
2357
1157
  rc = await f();
@@ -2396,13 +1196,13 @@ function decl(s) {
2396
1196
  }
2397
1197
 
2398
1198
 
2399
- /***/ }),
1199
+ /***/ },
2400
1200
 
2401
- /***/ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-constants.js":
1201
+ /***/ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-constants.js"
2402
1202
  /*!*************************************************************************!*\
2403
1203
  !*** ../../node_modules/@journeyapps/wa-sqlite/src/sqlite-constants.js ***!
2404
1204
  \*************************************************************************/
2405
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1205
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
2406
1206
 
2407
1207
  __webpack_require__.r(__webpack_exports__);
2408
1208
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -2915,13 +1715,13 @@ const SQLITE_PREPARE_PERSISTENT = 0x01;
2915
1715
  const SQLITE_PREPARE_NORMALIZED = 0x02;
2916
1716
  const SQLITE_PREPARE_NO_VTAB = 0x04;
2917
1717
 
2918
- /***/ }),
1718
+ /***/ },
2919
1719
 
2920
- /***/ "../../node_modules/async-mutex/index.mjs":
1720
+ /***/ "../../node_modules/async-mutex/index.mjs"
2921
1721
  /*!************************************************!*\
2922
1722
  !*** ../../node_modules/async-mutex/index.mjs ***!
2923
1723
  \************************************************/
2924
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
1724
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
2925
1725
 
2926
1726
  __webpack_require__.r(__webpack_exports__);
2927
1727
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -3226,13 +2026,13 @@ function tryAcquire(sync, alreadyAcquiredError = E_ALREADY_LOCKED) {
3226
2026
 
3227
2027
 
3228
2028
 
3229
- /***/ }),
2029
+ /***/ },
3230
2030
 
3231
- /***/ "../../node_modules/comlink/dist/esm/comlink.mjs":
2031
+ /***/ "../../node_modules/comlink/dist/esm/comlink.mjs"
3232
2032
  /*!*******************************************************!*\
3233
2033
  !*** ../../node_modules/comlink/dist/esm/comlink.mjs ***!
3234
2034
  \*******************************************************/
3235
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2035
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3236
2036
 
3237
2037
  __webpack_require__.r(__webpack_exports__);
3238
2038
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -3607,13 +2407,13 @@ function generateUUID() {
3607
2407
  //# sourceMappingURL=comlink.mjs.map
3608
2408
 
3609
2409
 
3610
- /***/ }),
2410
+ /***/ },
3611
2411
 
3612
- /***/ "../common/dist/bundle.mjs":
2412
+ /***/ "../common/dist/bundle.mjs"
3613
2413
  /*!*********************************!*\
3614
2414
  !*** ../common/dist/bundle.mjs ***!
3615
2415
  \*********************************/
3616
- /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2416
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3617
2417
 
3618
2418
  __webpack_require__.r(__webpack_exports__);
3619
2419
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -3627,6 +2427,7 @@ __webpack_require__.r(__webpack_exports__);
3627
2427
  /* harmony export */ BaseObserver: () => (/* binding */ BaseObserver),
3628
2428
  /* harmony export */ Column: () => (/* binding */ Column),
3629
2429
  /* harmony export */ ColumnType: () => (/* binding */ ColumnType),
2430
+ /* harmony export */ ConnectionClosedError: () => (/* binding */ ConnectionClosedError),
3630
2431
  /* harmony export */ ConnectionManager: () => (/* binding */ ConnectionManager),
3631
2432
  /* harmony export */ ControlledExecutor: () => (/* binding */ ControlledExecutor),
3632
2433
  /* harmony export */ CrudBatch: () => (/* binding */ CrudBatch),
@@ -4441,6 +3242,10 @@ class SyncStatus {
4441
3242
  priorityStatusEntries: this.priorityStatusEntries
4442
3243
  };
4443
3244
  }
3245
+ /**
3246
+ * Not all errors are serializable over a MessagePort. E.g. some `DomExceptions` fail to be passed across workers.
3247
+ * This explicitly serializes errors in the SyncStatus.
3248
+ */
4444
3249
  serializeError(error) {
4445
3250
  if (typeof error == 'undefined') {
4446
3251
  return undefined;
@@ -6063,7 +4868,7 @@ var hasRequiredBuffer$1;
6063
4868
  function requireBuffer$1 () {
6064
4869
  if (hasRequiredBuffer$1) return buffer$1;
6065
4870
  hasRequiredBuffer$1 = 1;
6066
- (function (exports) {
4871
+ (function (exports$1) {
6067
4872
 
6068
4873
  const base64 = requireBase64Js();
6069
4874
  const ieee754 = requireIeee754();
@@ -6072,12 +4877,12 @@ function requireBuffer$1 () {
6072
4877
  ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
6073
4878
  : null;
6074
4879
 
6075
- exports.Buffer = Buffer;
6076
- exports.SlowBuffer = SlowBuffer;
6077
- exports.INSPECT_MAX_BYTES = 50;
4880
+ exports$1.Buffer = Buffer;
4881
+ exports$1.SlowBuffer = SlowBuffer;
4882
+ exports$1.INSPECT_MAX_BYTES = 50;
6078
4883
 
6079
4884
  const K_MAX_LENGTH = 0x7fffffff;
6080
- exports.kMaxLength = K_MAX_LENGTH;
4885
+ exports$1.kMaxLength = K_MAX_LENGTH;
6081
4886
 
6082
4887
  /**
6083
4888
  * If `Buffer.TYPED_ARRAY_SUPPORT`:
@@ -6673,7 +5478,7 @@ function requireBuffer$1 () {
6673
5478
 
6674
5479
  Buffer.prototype.inspect = function inspect () {
6675
5480
  let str = '';
6676
- const max = exports.INSPECT_MAX_BYTES;
5481
+ const max = exports$1.INSPECT_MAX_BYTES;
6677
5482
  str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim();
6678
5483
  if (this.length > max) str += ' ... ';
6679
5484
  return '<Buffer ' + str + '>'
@@ -8181,7 +6986,7 @@ var hasRequiredBuffer;
8181
6986
  function requireBuffer () {
8182
6987
  if (hasRequiredBuffer) return buffer;
8183
6988
  hasRequiredBuffer = 1;
8184
- (function (exports) {
6989
+ (function (exports$1) {
8185
6990
 
8186
6991
  var base64 = requireBase64Js();
8187
6992
  var ieee754 = requireIeee754();
@@ -8190,12 +6995,12 @@ function requireBuffer () {
8190
6995
  ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation
8191
6996
  : null;
8192
6997
 
8193
- exports.Buffer = Buffer;
8194
- exports.SlowBuffer = SlowBuffer;
8195
- exports.INSPECT_MAX_BYTES = 50;
6998
+ exports$1.Buffer = Buffer;
6999
+ exports$1.SlowBuffer = SlowBuffer;
7000
+ exports$1.INSPECT_MAX_BYTES = 50;
8196
7001
 
8197
7002
  var K_MAX_LENGTH = 0x7fffffff;
8198
- exports.kMaxLength = K_MAX_LENGTH;
7003
+ exports$1.kMaxLength = K_MAX_LENGTH;
8199
7004
 
8200
7005
  /**
8201
7006
  * If `Buffer.TYPED_ARRAY_SUPPORT`:
@@ -8792,7 +7597,7 @@ function requireBuffer () {
8792
7597
 
8793
7598
  Buffer.prototype.inspect = function inspect () {
8794
7599
  var str = '';
8795
- var max = exports.INSPECT_MAX_BYTES;
7600
+ var max = exports$1.INSPECT_MAX_BYTES;
8796
7601
  str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim();
8797
7602
  if (this.length > max) str += ' ... ';
8798
7603
  return '<Buffer ' + str + '>'
@@ -10005,7 +8810,7 @@ var hasRequiredFrames;
10005
8810
  function requireFrames () {
10006
8811
  if (hasRequiredFrames) return Frames;
10007
8812
  hasRequiredFrames = 1;
10008
- (function (exports) {
8813
+ (function (exports$1) {
10009
8814
  /*
10010
8815
  * Copyright 2021-2022 the original author or authors.
10011
8816
  *
@@ -10021,8 +8826,8 @@ function requireFrames () {
10021
8826
  * See the License for the specific language governing permissions and
10022
8827
  * limitations under the License.
10023
8828
  */
10024
- Object.defineProperty(exports, "__esModule", { value: true });
10025
- exports.Frame = exports.Lengths = exports.Flags = exports.FrameTypes = void 0;
8829
+ Object.defineProperty(exports$1, "__esModule", { value: true });
8830
+ exports$1.Frame = exports$1.Lengths = exports$1.Flags = exports$1.FrameTypes = void 0;
10026
8831
  var FrameTypes;
10027
8832
  (function (FrameTypes) {
10028
8833
  FrameTypes[FrameTypes["RESERVED"] = 0] = "RESERVED";
@@ -10041,7 +8846,7 @@ function requireFrames () {
10041
8846
  FrameTypes[FrameTypes["RESUME"] = 13] = "RESUME";
10042
8847
  FrameTypes[FrameTypes["RESUME_OK"] = 14] = "RESUME_OK";
10043
8848
  FrameTypes[FrameTypes["EXT"] = 63] = "EXT";
10044
- })(FrameTypes = exports.FrameTypes || (exports.FrameTypes = {}));
8849
+ })(FrameTypes = exports$1.FrameTypes || (exports$1.FrameTypes = {}));
10045
8850
  (function (Flags) {
10046
8851
  Flags[Flags["NONE"] = 0] = "NONE";
10047
8852
  Flags[Flags["COMPLETE"] = 64] = "COMPLETE";
@@ -10052,7 +8857,7 @@ function requireFrames () {
10052
8857
  Flags[Flags["NEXT"] = 32] = "NEXT";
10053
8858
  Flags[Flags["RESPOND"] = 128] = "RESPOND";
10054
8859
  Flags[Flags["RESUME_ENABLE"] = 128] = "RESUME_ENABLE";
10055
- })(exports.Flags || (exports.Flags = {}));
8860
+ })(exports$1.Flags || (exports$1.Flags = {}));
10056
8861
  (function (Flags) {
10057
8862
  function hasMetadata(flags) {
10058
8863
  return (flags & Flags.METADATA) === Flags.METADATA;
@@ -10086,13 +8891,13 @@ function requireFrames () {
10086
8891
  return (flags & Flags.RESUME_ENABLE) === Flags.RESUME_ENABLE;
10087
8892
  }
10088
8893
  Flags.hasResume = hasResume;
10089
- })(exports.Flags || (exports.Flags = {}));
8894
+ })(exports$1.Flags || (exports$1.Flags = {}));
10090
8895
  (function (Lengths) {
10091
8896
  Lengths[Lengths["FRAME"] = 3] = "FRAME";
10092
8897
  Lengths[Lengths["HEADER"] = 6] = "HEADER";
10093
8898
  Lengths[Lengths["METADATA"] = 3] = "METADATA";
10094
8899
  Lengths[Lengths["REQUEST"] = 3] = "REQUEST";
10095
- })(exports.Lengths || (exports.Lengths = {}));
8900
+ })(exports$1.Lengths || (exports$1.Lengths = {}));
10096
8901
  (function (Frame) {
10097
8902
  function isConnection(frame) {
10098
8903
  return frame.streamId === 0;
@@ -10103,7 +8908,7 @@ function requireFrames () {
10103
8908
  frame.type <= FrameTypes.REQUEST_CHANNEL);
10104
8909
  }
10105
8910
  Frame.isRequest = isRequest;
10106
- })(exports.Frame || (exports.Frame = {}));
8911
+ })(exports$1.Frame || (exports$1.Frame = {}));
10107
8912
 
10108
8913
  } (Frames));
10109
8914
  return Frames;
@@ -10114,7 +8919,7 @@ var hasRequiredCodecs;
10114
8919
  function requireCodecs () {
10115
8920
  if (hasRequiredCodecs) return Codecs;
10116
8921
  hasRequiredCodecs = 1;
10117
- (function (exports) {
8922
+ (function (exports$1) {
10118
8923
  var __generator = (Codecs && Codecs.__generator) || function (thisArg, body) {
10119
8924
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
10120
8925
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
@@ -10142,22 +8947,22 @@ function requireCodecs () {
10142
8947
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
10143
8948
  }
10144
8949
  };
10145
- Object.defineProperty(exports, "__esModule", { value: true });
10146
- exports.Deserializer = exports.sizeOfFrame = exports.serializeFrame = exports.deserializeFrame = exports.serializeFrameWithLength = exports.deserializeFrames = exports.deserializeFrameWithLength = exports.writeUInt64BE = exports.readUInt64BE = exports.writeUInt24BE = exports.readUInt24BE = exports.MAX_VERSION = exports.MAX_TTL = exports.MAX_STREAM_ID = exports.MAX_RESUME_LENGTH = exports.MAX_REQUEST_N = exports.MAX_REQUEST_COUNT = exports.MAX_MIME_LENGTH = exports.MAX_METADATA_LENGTH = exports.MAX_LIFETIME = exports.MAX_KEEPALIVE = exports.MAX_CODE = exports.FRAME_TYPE_OFFFSET = exports.FLAGS_MASK = void 0;
8950
+ Object.defineProperty(exports$1, "__esModule", { value: true });
8951
+ exports$1.Deserializer = exports$1.sizeOfFrame = exports$1.serializeFrame = exports$1.deserializeFrame = exports$1.serializeFrameWithLength = exports$1.deserializeFrames = exports$1.deserializeFrameWithLength = exports$1.writeUInt64BE = exports$1.readUInt64BE = exports$1.writeUInt24BE = exports$1.readUInt24BE = exports$1.MAX_VERSION = exports$1.MAX_TTL = exports$1.MAX_STREAM_ID = exports$1.MAX_RESUME_LENGTH = exports$1.MAX_REQUEST_N = exports$1.MAX_REQUEST_COUNT = exports$1.MAX_MIME_LENGTH = exports$1.MAX_METADATA_LENGTH = exports$1.MAX_LIFETIME = exports$1.MAX_KEEPALIVE = exports$1.MAX_CODE = exports$1.FRAME_TYPE_OFFFSET = exports$1.FLAGS_MASK = void 0;
10147
8952
  var Frames_1 = requireFrames();
10148
- exports.FLAGS_MASK = 0x3ff; // low 10 bits
10149
- exports.FRAME_TYPE_OFFFSET = 10; // frame type is offset 10 bytes within the uint16 containing type + flags
10150
- exports.MAX_CODE = 0x7fffffff; // uint31
10151
- exports.MAX_KEEPALIVE = 0x7fffffff; // uint31
10152
- exports.MAX_LIFETIME = 0x7fffffff; // uint31
10153
- exports.MAX_METADATA_LENGTH = 0xffffff; // uint24
10154
- exports.MAX_MIME_LENGTH = 0xff; // int8
10155
- exports.MAX_REQUEST_COUNT = 0x7fffffff; // uint31
10156
- exports.MAX_REQUEST_N = 0x7fffffff; // uint31
10157
- exports.MAX_RESUME_LENGTH = 0xffff; // uint16
10158
- exports.MAX_STREAM_ID = 0x7fffffff; // uint31
10159
- exports.MAX_TTL = 0x7fffffff; // uint31
10160
- exports.MAX_VERSION = 0xffff; // uint16
8953
+ exports$1.FLAGS_MASK = 0x3ff; // low 10 bits
8954
+ exports$1.FRAME_TYPE_OFFFSET = 10; // frame type is offset 10 bytes within the uint16 containing type + flags
8955
+ exports$1.MAX_CODE = 0x7fffffff; // uint31
8956
+ exports$1.MAX_KEEPALIVE = 0x7fffffff; // uint31
8957
+ exports$1.MAX_LIFETIME = 0x7fffffff; // uint31
8958
+ exports$1.MAX_METADATA_LENGTH = 0xffffff; // uint24
8959
+ exports$1.MAX_MIME_LENGTH = 0xff; // int8
8960
+ exports$1.MAX_REQUEST_COUNT = 0x7fffffff; // uint31
8961
+ exports$1.MAX_REQUEST_N = 0x7fffffff; // uint31
8962
+ exports$1.MAX_RESUME_LENGTH = 0xffff; // uint16
8963
+ exports$1.MAX_STREAM_ID = 0x7fffffff; // uint31
8964
+ exports$1.MAX_TTL = 0x7fffffff; // uint31
8965
+ exports$1.MAX_VERSION = 0xffff; // uint16
10161
8966
  /**
10162
8967
  * Mimimum value that would overflow bitwise operators (2^32).
10163
8968
  */
@@ -10171,7 +8976,7 @@ function requireCodecs () {
10171
8976
  var val3 = buffer.readUInt8(offset + 2);
10172
8977
  return val1 | val2 | val3;
10173
8978
  }
10174
- exports.readUInt24BE = readUInt24BE;
8979
+ exports$1.readUInt24BE = readUInt24BE;
10175
8980
  /**
10176
8981
  * Writes a uint24 to a buffer starting at the given offset, returning the
10177
8982
  * offset of the next byte.
@@ -10181,7 +8986,7 @@ function requireCodecs () {
10181
8986
  offset = buffer.writeUInt8((value >>> 8) & 0xff, offset); // 2nd byte
10182
8987
  return buffer.writeUInt8(value & 0xff, offset); // 1st byte
10183
8988
  }
10184
- exports.writeUInt24BE = writeUInt24BE;
8989
+ exports$1.writeUInt24BE = writeUInt24BE;
10185
8990
  /**
10186
8991
  * Read a uint64 (technically supports up to 53 bits per JS number
10187
8992
  * representation).
@@ -10191,7 +8996,7 @@ function requireCodecs () {
10191
8996
  var low = buffer.readUInt32BE(offset + 4);
10192
8997
  return high * BITWISE_OVERFLOW + low;
10193
8998
  }
10194
- exports.readUInt64BE = readUInt64BE;
8999
+ exports$1.readUInt64BE = readUInt64BE;
10195
9000
  /**
10196
9001
  * Write a uint64 (technically supports up to 53 bits per JS number
10197
9002
  * representation).
@@ -10202,7 +9007,7 @@ function requireCodecs () {
10202
9007
  offset = buffer.writeUInt32BE(high, offset); // first half of uint64
10203
9008
  return buffer.writeUInt32BE(low, offset); // second half of uint64
10204
9009
  }
10205
- exports.writeUInt64BE = writeUInt64BE;
9010
+ exports$1.writeUInt64BE = writeUInt64BE;
10206
9011
  /**
10207
9012
  * Frame header is:
10208
9013
  * - stream id (uint32 = 4)
@@ -10220,7 +9025,7 @@ function requireCodecs () {
10220
9025
  var frameLength = readUInt24BE(buffer, 0);
10221
9026
  return deserializeFrame(buffer.slice(UINT24_SIZE, UINT24_SIZE + frameLength));
10222
9027
  }
10223
- exports.deserializeFrameWithLength = deserializeFrameWithLength;
9028
+ exports$1.deserializeFrameWithLength = deserializeFrameWithLength;
10224
9029
  /**
10225
9030
  * Given a buffer that may contain zero or more length-prefixed frames followed
10226
9031
  * by zero or more bytes of a (partial) subsequent frame, returns an array of
@@ -10253,7 +9058,7 @@ function requireCodecs () {
10253
9058
  }
10254
9059
  });
10255
9060
  }
10256
- exports.deserializeFrames = deserializeFrames;
9061
+ exports$1.deserializeFrames = deserializeFrames;
10257
9062
  /**
10258
9063
  * Writes a frame to a buffer with a length prefix.
10259
9064
  */
@@ -10264,7 +9069,7 @@ function requireCodecs () {
10264
9069
  buffer.copy(lengthPrefixed, UINT24_SIZE);
10265
9070
  return lengthPrefixed;
10266
9071
  }
10267
- exports.serializeFrameWithLength = serializeFrameWithLength;
9072
+ exports$1.serializeFrameWithLength = serializeFrameWithLength;
10268
9073
  /**
10269
9074
  * Read a frame from the buffer.
10270
9075
  */
@@ -10279,8 +9084,8 @@ function requireCodecs () {
10279
9084
  // );
10280
9085
  var typeAndFlags = buffer.readUInt16BE(offset);
10281
9086
  offset += 2;
10282
- var type = typeAndFlags >>> exports.FRAME_TYPE_OFFFSET; // keep highest 6 bits
10283
- var flags = typeAndFlags & exports.FLAGS_MASK; // keep lowest 10 bits
9087
+ var type = typeAndFlags >>> exports$1.FRAME_TYPE_OFFFSET; // keep highest 6 bits
9088
+ var flags = typeAndFlags & exports$1.FLAGS_MASK; // keep lowest 10 bits
10284
9089
  switch (type) {
10285
9090
  case Frames_1.FrameTypes.SETUP:
10286
9091
  return deserializeSetupFrame(buffer, streamId, flags);
@@ -10317,7 +9122,7 @@ function requireCodecs () {
10317
9122
  // );
10318
9123
  }
10319
9124
  }
10320
- exports.deserializeFrame = deserializeFrame;
9125
+ exports$1.deserializeFrame = deserializeFrame;
10321
9126
  /**
10322
9127
  * Convert the frame to a (binary) buffer.
10323
9128
  */
@@ -10356,7 +9161,7 @@ function requireCodecs () {
10356
9161
  // );
10357
9162
  }
10358
9163
  }
10359
- exports.serializeFrame = serializeFrame;
9164
+ exports$1.serializeFrame = serializeFrame;
10360
9165
  /**
10361
9166
  * Byte size of frame without size prefix
10362
9167
  */
@@ -10395,7 +9200,7 @@ function requireCodecs () {
10395
9200
  // );
10396
9201
  }
10397
9202
  }
10398
- exports.sizeOfFrame = sizeOfFrame;
9203
+ exports$1.sizeOfFrame = sizeOfFrame;
10399
9204
  /**
10400
9205
  * Writes a SETUP frame into a new buffer and returns it.
10401
9206
  *
@@ -11030,7 +9835,7 @@ function requireCodecs () {
11030
9835
  function writeHeader(frame, buffer) {
11031
9836
  var offset = buffer.writeInt32BE(frame.streamId, 0);
11032
9837
  // shift frame to high 6 bits, extract lowest 10 bits from flags
11033
- return buffer.writeUInt16BE((frame.type << exports.FRAME_TYPE_OFFFSET) | (frame.flags & exports.FLAGS_MASK), offset);
9838
+ return buffer.writeUInt16BE((frame.type << exports$1.FRAME_TYPE_OFFFSET) | (frame.flags & exports$1.FLAGS_MASK), offset);
11034
9839
  }
11035
9840
  /**
11036
9841
  * Determine the length of the payload section of a frame. Only applies to
@@ -11111,7 +9916,7 @@ function requireCodecs () {
11111
9916
  };
11112
9917
  return Deserializer;
11113
9918
  }());
11114
- exports.Deserializer = Deserializer;
9919
+ exports$1.Deserializer = Deserializer;
11115
9920
 
11116
9921
  } (Codecs));
11117
9922
  return Codecs;
@@ -11257,7 +10062,7 @@ var hasRequiredErrors;
11257
10062
  function requireErrors () {
11258
10063
  if (hasRequiredErrors) return Errors;
11259
10064
  hasRequiredErrors = 1;
11260
- (function (exports) {
10065
+ (function (exports$1) {
11261
10066
  /*
11262
10067
  * Copyright 2021-2022 the original author or authors.
11263
10068
  *
@@ -11288,8 +10093,8 @@ function requireErrors () {
11288
10093
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
11289
10094
  };
11290
10095
  })();
11291
- Object.defineProperty(exports, "__esModule", { value: true });
11292
- exports.ErrorCodes = exports.RSocketError = void 0;
10096
+ Object.defineProperty(exports$1, "__esModule", { value: true });
10097
+ exports$1.ErrorCodes = exports$1.RSocketError = void 0;
11293
10098
  var RSocketError = /** @class */ (function (_super) {
11294
10099
  __extends(RSocketError, _super);
11295
10100
  function RSocketError(code, message) {
@@ -11299,7 +10104,7 @@ function requireErrors () {
11299
10104
  }
11300
10105
  return RSocketError;
11301
10106
  }(Error));
11302
- exports.RSocketError = RSocketError;
10107
+ exports$1.RSocketError = RSocketError;
11303
10108
  (function (ErrorCodes) {
11304
10109
  ErrorCodes[ErrorCodes["RESERVED"] = 0] = "RESERVED";
11305
10110
  ErrorCodes[ErrorCodes["INVALID_SETUP"] = 1] = "INVALID_SETUP";
@@ -11313,7 +10118,7 @@ function requireErrors () {
11313
10118
  ErrorCodes[ErrorCodes["CANCELED"] = 515] = "CANCELED";
11314
10119
  ErrorCodes[ErrorCodes["INVALID"] = 516] = "INVALID";
11315
10120
  ErrorCodes[ErrorCodes["RESERVED_EXTENSION"] = 4294967295] = "RESERVED_EXTENSION";
11316
- })(exports.ErrorCodes || (exports.ErrorCodes = {}));
10121
+ })(exports$1.ErrorCodes || (exports$1.ErrorCodes = {}));
11317
10122
 
11318
10123
  } (Errors));
11319
10124
  return Errors;
@@ -11355,7 +10160,7 @@ var hasRequiredClientServerMultiplexerDemultiplexer;
11355
10160
  function requireClientServerMultiplexerDemultiplexer () {
11356
10161
  if (hasRequiredClientServerMultiplexerDemultiplexer) return ClientServerMultiplexerDemultiplexer;
11357
10162
  hasRequiredClientServerMultiplexerDemultiplexer = 1;
11358
- (function (exports) {
10163
+ (function (exports$1) {
11359
10164
  /*
11360
10165
  * Copyright 2021-2022 the original author or authors.
11361
10166
  *
@@ -11422,8 +10227,8 @@ function requireClientServerMultiplexerDemultiplexer () {
11422
10227
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
11423
10228
  }
11424
10229
  };
11425
- Object.defineProperty(exports, "__esModule", { value: true });
11426
- exports.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer = exports.ResumableClientServerInputMultiplexerDemultiplexer = exports.ClientServerInputMultiplexerDemultiplexer = exports.StreamIdGenerator = void 0;
10230
+ Object.defineProperty(exports$1, "__esModule", { value: true });
10231
+ exports$1.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer = exports$1.ResumableClientServerInputMultiplexerDemultiplexer = exports$1.ClientServerInputMultiplexerDemultiplexer = exports$1.StreamIdGenerator = void 0;
11427
10232
  var _1 = requireDist();
11428
10233
  var Deferred_1 = requireDeferred();
11429
10234
  var Errors_1 = requireErrors();
@@ -11446,7 +10251,7 @@ function requireClientServerMultiplexerDemultiplexer () {
11446
10251
  };
11447
10252
  return StreamIdGeneratorImpl;
11448
10253
  }());
11449
- })(exports.StreamIdGenerator || (exports.StreamIdGenerator = {}));
10254
+ })(exports$1.StreamIdGenerator || (exports$1.StreamIdGenerator = {}));
11450
10255
  var ClientServerInputMultiplexerDemultiplexer = /** @class */ (function (_super) {
11451
10256
  __extends(ClientServerInputMultiplexerDemultiplexer, _super);
11452
10257
  function ClientServerInputMultiplexerDemultiplexer(streamIdSupplier, outbound, closeable) {
@@ -11535,7 +10340,7 @@ function requireClientServerMultiplexerDemultiplexer () {
11535
10340
  };
11536
10341
  return ClientServerInputMultiplexerDemultiplexer;
11537
10342
  }(Deferred_1.Deferred));
11538
- exports.ClientServerInputMultiplexerDemultiplexer = ClientServerInputMultiplexerDemultiplexer;
10343
+ exports$1.ClientServerInputMultiplexerDemultiplexer = ClientServerInputMultiplexerDemultiplexer;
11539
10344
  var ResumableClientServerInputMultiplexerDemultiplexer = /** @class */ (function (_super) {
11540
10345
  __extends(ResumableClientServerInputMultiplexerDemultiplexer, _super);
11541
10346
  function ResumableClientServerInputMultiplexerDemultiplexer(streamIdSupplier, outbound, closeable, frameStore, token, sessionStoreOrReconnector, sessionTimeout) {
@@ -11692,7 +10497,7 @@ function requireClientServerMultiplexerDemultiplexer () {
11692
10497
  };
11693
10498
  return ResumableClientServerInputMultiplexerDemultiplexer;
11694
10499
  }(ClientServerInputMultiplexerDemultiplexer));
11695
- exports.ResumableClientServerInputMultiplexerDemultiplexer = ResumableClientServerInputMultiplexerDemultiplexer;
10500
+ exports$1.ResumableClientServerInputMultiplexerDemultiplexer = ResumableClientServerInputMultiplexerDemultiplexer;
11696
10501
  var ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer = /** @class */ (function () {
11697
10502
  function ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer(outbound, closeable, delegate) {
11698
10503
  this.outbound = outbound;
@@ -11749,7 +10554,7 @@ function requireClientServerMultiplexerDemultiplexer () {
11749
10554
  };
11750
10555
  return ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer;
11751
10556
  }());
11752
- exports.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer = ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer;
10557
+ exports$1.ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer = ResumeOkAwaitingResumableClientServerInputMultiplexerDemultiplexer;
11753
10558
 
11754
10559
  } (ClientServerMultiplexerDemultiplexer));
11755
10560
  return ClientServerMultiplexerDemultiplexer;
@@ -14735,7 +13540,7 @@ var hasRequiredDist;
14735
13540
  function requireDist () {
14736
13541
  if (hasRequiredDist) return dist;
14737
13542
  hasRequiredDist = 1;
14738
- (function (exports) {
13543
+ (function (exports$1) {
14739
13544
  /*
14740
13545
  * Copyright 2021-2022 the original author or authors.
14741
13546
  *
@@ -14758,19 +13563,19 @@ function requireDist () {
14758
13563
  if (k2 === undefined) k2 = k;
14759
13564
  o[k2] = m[k];
14760
13565
  }));
14761
- var __exportStar = (dist && dist.__exportStar) || function(m, exports) {
14762
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
13566
+ var __exportStar = (dist && dist.__exportStar) || function(m, exports$1) {
13567
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
14763
13568
  };
14764
- Object.defineProperty(exports, "__esModule", { value: true });
14765
- __exportStar(requireCodecs(), exports);
14766
- __exportStar(requireCommon(), exports);
14767
- __exportStar(requireDeferred(), exports);
14768
- __exportStar(requireErrors(), exports);
14769
- __exportStar(requireFrames(), exports);
14770
- __exportStar(requireRSocket(), exports);
14771
- __exportStar(requireRSocketConnector(), exports);
14772
- __exportStar(requireRSocketServer(), exports);
14773
- __exportStar(requireTransport(), exports);
13569
+ Object.defineProperty(exports$1, "__esModule", { value: true });
13570
+ __exportStar(requireCodecs(), exports$1);
13571
+ __exportStar(requireCommon(), exports$1);
13572
+ __exportStar(requireDeferred(), exports$1);
13573
+ __exportStar(requireErrors(), exports$1);
13574
+ __exportStar(requireFrames(), exports$1);
13575
+ __exportStar(requireRSocket(), exports$1);
13576
+ __exportStar(requireRSocketConnector(), exports$1);
13577
+ __exportStar(requireRSocketServer(), exports$1);
13578
+ __exportStar(requireTransport(), exports$1);
14774
13579
 
14775
13580
  } (dist));
14776
13581
  return dist;
@@ -14778,7 +13583,7 @@ function requireDist () {
14778
13583
 
14779
13584
  var distExports = requireDist();
14780
13585
 
14781
- var version = "1.43.1";
13586
+ var version = "1.45.0";
14782
13587
  var PACKAGE = {
14783
13588
  version: version};
14784
13589
 
@@ -15705,6 +14510,7 @@ const DEFAULT_STREAMING_SYNC_OPTIONS = {
15705
14510
  crudUploadThrottleMs: DEFAULT_CRUD_UPLOAD_THROTTLE_MS
15706
14511
  };
15707
14512
  const DEFAULT_STREAM_CONNECTION_OPTIONS = {
14513
+ appMetadata: {},
15708
14514
  connectionMethod: SyncStreamConnectionMethod.WEB_SOCKET,
15709
14515
  clientImplementation: DEFAULT_SYNC_CLIENT_IMPLEMENTATION,
15710
14516
  fetchStrategy: FetchStrategy.Buffered,
@@ -16083,6 +14889,11 @@ The next upload iteration will be delayed.`);
16083
14889
  ...DEFAULT_STREAM_CONNECTION_OPTIONS,
16084
14890
  ...(options ?? {})
16085
14891
  };
14892
+ // Validate app metadata
14893
+ const invalidMetadata = Object.entries(resolvedOptions.appMetadata).filter(([_, value]) => typeof value != 'string');
14894
+ if (invalidMetadata.length > 0) {
14895
+ throw new Error(`Invalid appMetadata provided. Only string values are allowed. Invalid values: ${invalidMetadata.map(([key, value]) => `${key}: ${value}`).join(', ')}`);
14896
+ }
16086
14897
  const clientImplementation = resolvedOptions.clientImplementation;
16087
14898
  this.updateSyncStatus({ clientImplementation });
16088
14899
  if (clientImplementation == SyncClientImplementation.JAVASCRIPT) {
@@ -16118,6 +14929,7 @@ The next upload iteration will be delayed.`);
16118
14929
  include_checksum: true,
16119
14930
  raw_data: true,
16120
14931
  parameters: resolvedOptions.params,
14932
+ app_metadata: resolvedOptions.appMetadata,
16121
14933
  client_id: clientId
16122
14934
  }
16123
14935
  };
@@ -16477,6 +15289,7 @@ The next upload iteration will be delayed.`);
16477
15289
  try {
16478
15290
  const options = {
16479
15291
  parameters: resolvedOptions.params,
15292
+ app_metadata: resolvedOptions.appMetadata,
16480
15293
  active_streams: this.activeStreams,
16481
15294
  include_defaults: resolvedOptions.includeDefaultStreams
16482
15295
  };
@@ -17113,14 +15926,14 @@ class AbstractPowerSyncDatabase extends BaseObserver {
17113
15926
  async initialize() {
17114
15927
  await this._initialize();
17115
15928
  await this.bucketStorageAdapter.init();
17116
- await this._loadVersion();
15929
+ await this.loadVersion();
17117
15930
  await this.updateSchema(this.options.schema);
17118
15931
  await this.resolveOfflineSyncStatus();
17119
15932
  await this.database.execute('PRAGMA RECURSIVE_TRIGGERS=TRUE');
17120
15933
  this.ready = true;
17121
15934
  this.iterateListeners((cb) => cb.initialized?.());
17122
15935
  }
17123
- async _loadVersion() {
15936
+ async loadVersion() {
17124
15937
  try {
17125
15938
  const { version } = await this.database.get('SELECT powersync_rs_version() as version');
17126
15939
  this.sdkVersion = version;
@@ -17135,11 +15948,11 @@ class AbstractPowerSyncDatabase extends BaseObserver {
17135
15948
  .map((n) => parseInt(n));
17136
15949
  }
17137
15950
  catch (e) {
17138
- throw new Error(`Unsupported powersync extension version. Need >=0.4.5 <1.0.0, got: ${this.sdkVersion}. Details: ${e.message}`);
15951
+ throw new Error(`Unsupported powersync extension version. Need >=0.4.10 <1.0.0, got: ${this.sdkVersion}. Details: ${e.message}`);
17139
15952
  }
17140
- // Validate >=0.4.5 <1.0.0
17141
- if (versionInts[0] != 0 || versionInts[1] < 4 || (versionInts[1] == 4 && versionInts[2] < 5)) {
17142
- throw new Error(`Unsupported powersync extension version. Need >=0.4.5 <1.0.0, got: ${this.sdkVersion}`);
15953
+ // Validate >=0.4.10 <1.0.0
15954
+ if (versionInts[0] != 0 || versionInts[1] < 4 || (versionInts[1] == 4 && versionInts[2] < 10)) {
15955
+ throw new Error(`Unsupported powersync extension version. Need >=0.4.10 <1.0.0, got: ${this.sdkVersion}`);
17143
15956
  }
17144
15957
  }
17145
15958
  async resolveOfflineSyncStatus() {
@@ -18259,6 +17072,27 @@ class SyncDataBatch {
18259
17072
  }
18260
17073
  }
18261
17074
 
17075
+ /**
17076
+ * Thrown when an underlying database connection is closed.
17077
+ * This is particularly relevant when worker connections are marked as closed while
17078
+ * operations are still in progress.
17079
+ */
17080
+ class ConnectionClosedError extends Error {
17081
+ static NAME = 'ConnectionClosedError';
17082
+ static MATCHES(input) {
17083
+ /**
17084
+ * If there are weird package issues which cause multiple versions of classes to be present, the instanceof
17085
+ * check might fail. This also performs a failsafe check.
17086
+ * This might also happen if the Error is serialized and parsed over a bridging channel like a MessagePort.
17087
+ */
17088
+ return (input instanceof ConnectionClosedError || (input instanceof Error && input.name == ConnectionClosedError.NAME));
17089
+ }
17090
+ constructor(message) {
17091
+ super(message);
17092
+ this.name = ConnectionClosedError.NAME;
17093
+ }
17094
+ }
17095
+
18262
17096
  // https://www.sqlite.org/lang_expr.html#castexpr
18263
17097
  var ColumnType;
18264
17098
  (function (ColumnType) {
@@ -18802,64 +17636,37 @@ const parseQuery = (query, parameters) => {
18802
17636
  sqlStatement = query;
18803
17637
  }
18804
17638
  else {
18805
- const hasAdditionalParameters = parameters.length > 0;
18806
- if (hasAdditionalParameters) {
18807
- throw new Error('You cannot pass parameters to a compiled query.');
18808
- }
18809
- const compiled = query.compile();
18810
- sqlStatement = compiled.sql;
18811
- parameters = compiled.parameters;
18812
- }
18813
- return { sqlStatement, parameters: parameters };
18814
- };
18815
-
18816
-
18817
- //# sourceMappingURL=bundle.mjs.map
18818
-
18819
-
18820
- /***/ }),
18821
-
18822
- /***/ "./lib/src/db/adapters/AsyncDatabaseConnection.js":
18823
- /*!********************************************************!*\
18824
- !*** ./lib/src/db/adapters/AsyncDatabaseConnection.js ***!
18825
- \********************************************************/
18826
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18827
-
18828
- __webpack_require__.r(__webpack_exports__);
18829
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18830
- /* harmony export */ ConnectionClosedError: () => (/* binding */ ConnectionClosedError)
18831
- /* harmony export */ });
18832
- /**
18833
- * Thrown when an underlying database connection is closed.
18834
- * This is particularly relevant when worker connections are marked as closed while
18835
- * operations are still in progress.
18836
- */
18837
- class ConnectionClosedError extends Error {
18838
- constructor(message) {
18839
- super(message);
18840
- this.name = 'ConnectionClosedError';
17639
+ const hasAdditionalParameters = parameters.length > 0;
17640
+ if (hasAdditionalParameters) {
17641
+ throw new Error('You cannot pass parameters to a compiled query.');
17642
+ }
17643
+ const compiled = query.compile();
17644
+ sqlStatement = compiled.sql;
17645
+ parameters = compiled.parameters;
18841
17646
  }
18842
- }
17647
+ return { sqlStatement, parameters: parameters };
17648
+ };
17649
+
17650
+
17651
+ //# sourceMappingURL=bundle.mjs.map
18843
17652
 
18844
17653
 
18845
- /***/ }),
17654
+ /***/ },
18846
17655
 
18847
- /***/ "./lib/src/db/adapters/LockedAsyncDatabaseAdapter.js":
17656
+ /***/ "./lib/src/db/adapters/LockedAsyncDatabaseAdapter.js"
18848
17657
  /*!***********************************************************!*\
18849
17658
  !*** ./lib/src/db/adapters/LockedAsyncDatabaseAdapter.js ***!
18850
17659
  \***********************************************************/
18851
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
17660
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
18852
17661
 
18853
17662
  __webpack_require__.r(__webpack_exports__);
18854
17663
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18855
17664
  /* harmony export */ LockedAsyncDatabaseAdapter: () => (/* binding */ LockedAsyncDatabaseAdapter)
18856
17665
  /* harmony export */ });
18857
17666
  /* harmony import */ var _powersync_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @powersync/common */ "../common/dist/bundle.mjs");
18858
- /* harmony import */ var _shared_navigator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/navigator */ "./lib/src/shared/navigator.js");
18859
- /* harmony import */ var _AsyncDatabaseConnection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AsyncDatabaseConnection */ "./lib/src/db/adapters/AsyncDatabaseConnection.js");
18860
- /* harmony import */ var _WorkerWrappedAsyncDatabaseConnection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./WorkerWrappedAsyncDatabaseConnection */ "./lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js");
18861
- /* harmony import */ var _wa_sqlite_WASQLiteConnection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./wa-sqlite/WASQLiteConnection */ "./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js");
18862
-
17667
+ /* harmony import */ var _shared_navigator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/navigator.js */ "./lib/src/shared/navigator.js");
17668
+ /* harmony import */ var _WorkerWrappedAsyncDatabaseConnection_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./WorkerWrappedAsyncDatabaseConnection.js */ "./lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js");
17669
+ /* harmony import */ var _wa_sqlite_WASQLiteConnection_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wa-sqlite/WASQLiteConnection.js */ "./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js");
18863
17670
 
18864
17671
 
18865
17672
 
@@ -18952,7 +17759,7 @@ class LockedAsyncDatabaseAdapter extends _powersync_common__WEBPACK_IMPORTED_MOD
18952
17759
  /**
18953
17760
  * This is only required for the long-lived shared IndexedDB connections.
18954
17761
  */
18955
- this.requiresHolds = this._config.vfs == _wa_sqlite_WASQLiteConnection__WEBPACK_IMPORTED_MODULE_4__.WASQLiteVFS.IDBBatchAtomicVFS;
17762
+ this.requiresHolds = this._config.vfs == _wa_sqlite_WASQLiteConnection_js__WEBPACK_IMPORTED_MODULE_3__.WASQLiteVFS.IDBBatchAtomicVFS;
18956
17763
  });
18957
17764
  }
18958
17765
  _reOpen() {
@@ -19006,7 +17813,7 @@ class LockedAsyncDatabaseAdapter extends _powersync_common__WEBPACK_IMPORTED_MOD
19006
17813
  await this.initPromise;
19007
17814
  }
19008
17815
  async shareConnection() {
19009
- if (false == this._db instanceof _WorkerWrappedAsyncDatabaseConnection__WEBPACK_IMPORTED_MODULE_3__.WorkerWrappedAsyncDatabaseConnection) {
17816
+ if (false == this._db instanceof _WorkerWrappedAsyncDatabaseConnection_js__WEBPACK_IMPORTED_MODULE_2__.WorkerWrappedAsyncDatabaseConnection) {
19010
17817
  throw new Error(`Only worker connections can be shared`);
19011
17818
  }
19012
17819
  return this._db.shareConnection();
@@ -19040,7 +17847,14 @@ class LockedAsyncDatabaseAdapter extends _powersync_common__WEBPACK_IMPORTED_MOD
19040
17847
  */
19041
17848
  async close() {
19042
17849
  this.closing = true;
19043
- this._disposeTableChangeListener?.();
17850
+ /**
17851
+ * Note that we obtain a reference to the callback to avoid calling the callback with `this` as the context.
17852
+ * This is to avoid Comlink attempting to clone `this` when calling the method.
17853
+ */
17854
+ const dispose = this._disposeTableChangeListener;
17855
+ if (dispose) {
17856
+ dispose();
17857
+ }
19044
17858
  this.pendingAbortControllers.forEach((controller) => controller.abort('Closed'));
19045
17859
  await this.baseDB?.close?.();
19046
17860
  this.closed = true;
@@ -19082,7 +17896,7 @@ class LockedAsyncDatabaseAdapter extends _powersync_common__WEBPACK_IMPORTED_MOD
19082
17896
  this.pendingAbortControllers.delete(abortController);
19083
17897
  }, timeoutMs)
19084
17898
  : null;
19085
- return (0,_shared_navigator__WEBPACK_IMPORTED_MODULE_1__.getNavigatorLocks)().request(`db-lock-${this._dbIdentifier}`, { signal: abortController.signal }, async () => {
17899
+ return (0,_shared_navigator_js__WEBPACK_IMPORTED_MODULE_1__.getNavigatorLocks)().request(`db-lock-${this._dbIdentifier}`, { signal: abortController.signal }, async () => {
19086
17900
  this.pendingAbortControllers.delete(abortController);
19087
17901
  if (timeoutId) {
19088
17902
  clearTimeout(timeoutId);
@@ -19092,23 +17906,30 @@ class LockedAsyncDatabaseAdapter extends _powersync_common__WEBPACK_IMPORTED_MOD
19092
17906
  }
19093
17907
  async acquireLock(callback, options) {
19094
17908
  await this.waitForInitialized();
17909
+ // The database is being opened in the background. Wait for it here.
17910
+ if (this.databaseOpenPromise) {
17911
+ await this.databaseOpenPromise;
17912
+ }
19095
17913
  return this._acquireLock(async () => {
19096
17914
  let holdId = null;
19097
17915
  try {
19098
- // The database is being opened in the background. Wait for it here.
19099
- if (this.databaseOpenPromise) {
19100
- /**
19101
- * We can't await this since it uses the same lock as we're in now.
19102
- */
19103
- throw new _AsyncDatabaseConnection__WEBPACK_IMPORTED_MODULE_2__.ConnectionClosedError('Connection is busy re-opening');
17916
+ /**
17917
+ * We can't await this since it uses the same lock as we're in now.
17918
+ * If there is a pending open, this call will throw.
17919
+ * If there is no pending open, but there is also no database - the open
17920
+ * might have failed. We need to re-open the database.
17921
+ */
17922
+ if (this.databaseOpenPromise || !this._db) {
17923
+ throw new _powersync_common__WEBPACK_IMPORTED_MODULE_0__.ConnectionClosedError('Connection is busy re-opening');
19104
17924
  }
19105
17925
  holdId = this.requiresHolds ? await this.baseDB.markHold() : null;
19106
17926
  return await callback();
19107
17927
  }
19108
17928
  catch (ex) {
19109
- if (ex instanceof _AsyncDatabaseConnection__WEBPACK_IMPORTED_MODULE_2__.ConnectionClosedError || (ex instanceof Error && ex.name === 'NoModificationAllowedError')) {
17929
+ if (_powersync_common__WEBPACK_IMPORTED_MODULE_0__.ConnectionClosedError.MATCHES(ex)) {
19110
17930
  if (this.options.reOpenOnConnectionClosed && !this.databaseOpenPromise && !this.closing) {
19111
17931
  // Immediately re-open the database. We need to miss as little table updates as possible.
17932
+ // Note, don't await this since it uses the same lock as we're in now.
19112
17933
  this.reOpenInternalDB();
19113
17934
  }
19114
17935
  }
@@ -19234,22 +18055,20 @@ class LockedAsyncDatabaseAdapter extends _powersync_common__WEBPACK_IMPORTED_MOD
19234
18055
  }
19235
18056
 
19236
18057
 
19237
- /***/ }),
18058
+ /***/ },
19238
18059
 
19239
- /***/ "./lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js":
18060
+ /***/ "./lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js"
19240
18061
  /*!*********************************************************************!*\
19241
18062
  !*** ./lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js ***!
19242
18063
  \*********************************************************************/
19243
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18064
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
19244
18065
 
19245
18066
  __webpack_require__.r(__webpack_exports__);
19246
18067
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19247
18068
  /* harmony export */ WorkerWrappedAsyncDatabaseConnection: () => (/* binding */ WorkerWrappedAsyncDatabaseConnection)
19248
18069
  /* harmony export */ });
19249
18070
  /* harmony import */ var _powersync_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @powersync/common */ "../common/dist/bundle.mjs");
19250
- /* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! comlink */ "../../node_modules/comlink/dist/esm/comlink.mjs");
19251
- /* harmony import */ var _AsyncDatabaseConnection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncDatabaseConnection */ "./lib/src/db/adapters/AsyncDatabaseConnection.js");
19252
-
18071
+ /* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! comlink */ "../../node_modules/comlink/dist/esm/comlink.mjs");
19253
18072
 
19254
18073
 
19255
18074
  /**
@@ -19299,7 +18118,7 @@ class WorkerWrappedAsyncDatabaseConnection extends _powersync_common__WEBPACK_IM
19299
18118
  if (controller) {
19300
18119
  return new Promise((resolve, reject) => {
19301
18120
  if (controller.signal.aborted) {
19302
- reject(new _AsyncDatabaseConnection__WEBPACK_IMPORTED_MODULE_1__.ConnectionClosedError('Called operation on closed remote'));
18121
+ reject(new _powersync_common__WEBPACK_IMPORTED_MODULE_0__.ConnectionClosedError('Called operation on closed remote'));
19303
18122
  if (!fireActionOnAbort) {
19304
18123
  // Don't run the operation if we're going to reject
19305
18124
  // We might want to fire-and-forget the operation in some cases (like a close operation)
@@ -19307,7 +18126,7 @@ class WorkerWrappedAsyncDatabaseConnection extends _powersync_common__WEBPACK_IM
19307
18126
  }
19308
18127
  }
19309
18128
  function handleAbort() {
19310
- reject(new _AsyncDatabaseConnection__WEBPACK_IMPORTED_MODULE_1__.ConnectionClosedError('Remote peer closed with request in flight'));
18129
+ reject(new _powersync_common__WEBPACK_IMPORTED_MODULE_0__.ConnectionClosedError('Remote peer closed with request in flight'));
19311
18130
  }
19312
18131
  function completePromise(action) {
19313
18132
  controller.signal.removeEventListener('abort', handleAbort);
@@ -19361,7 +18180,7 @@ class WorkerWrappedAsyncDatabaseConnection extends _powersync_common__WEBPACK_IM
19361
18180
  reject(ex);
19362
18181
  }
19363
18182
  }));
19364
- const newPort = await remote[comlink__WEBPACK_IMPORTED_MODULE_2__.createEndpoint]();
18183
+ const newPort = await remote[comlink__WEBPACK_IMPORTED_MODULE_1__.createEndpoint]();
19365
18184
  return { port: newPort, identifier };
19366
18185
  }
19367
18186
  /**
@@ -19369,7 +18188,7 @@ class WorkerWrappedAsyncDatabaseConnection extends _powersync_common__WEBPACK_IM
19369
18188
  * This can be extended by custom implementations in order to handle proxy events.
19370
18189
  */
19371
18190
  async registerOnTableChange(callback) {
19372
- return this.baseConnection.registerOnTableChange(comlink__WEBPACK_IMPORTED_MODULE_2__.proxy(callback));
18191
+ return this.baseConnection.registerOnTableChange(comlink__WEBPACK_IMPORTED_MODULE_1__.proxy(callback));
19373
18192
  }
19374
18193
  async close() {
19375
18194
  // Abort any pending lock requests.
@@ -19379,7 +18198,7 @@ class WorkerWrappedAsyncDatabaseConnection extends _powersync_common__WEBPACK_IM
19379
18198
  await this.withRemote(() => this.baseConnection.close(), true);
19380
18199
  }
19381
18200
  finally {
19382
- this.options.remote[comlink__WEBPACK_IMPORTED_MODULE_2__.releaseProxy]();
18201
+ this.options.remote[comlink__WEBPACK_IMPORTED_MODULE_1__.releaseProxy]();
19383
18202
  this.options.onClose?.();
19384
18203
  this.iterateListeners((l) => l.closing?.());
19385
18204
  }
@@ -19399,13 +18218,13 @@ class WorkerWrappedAsyncDatabaseConnection extends _powersync_common__WEBPACK_IM
19399
18218
  }
19400
18219
 
19401
18220
 
19402
- /***/ }),
18221
+ /***/ },
19403
18222
 
19404
- /***/ "./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js":
18223
+ /***/ "./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js"
19405
18224
  /*!*************************************************************!*\
19406
18225
  !*** ./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js ***!
19407
18226
  \*************************************************************/
19408
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18227
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
19409
18228
 
19410
18229
  __webpack_require__.r(__webpack_exports__);
19411
18230
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -19420,8 +18239,6 @@ __webpack_require__.r(__webpack_exports__);
19420
18239
  /* harmony import */ var _journeyapps_wa_sqlite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @journeyapps/wa-sqlite */ "../../node_modules/@journeyapps/wa-sqlite/src/sqlite-api.js");
19421
18240
  /* harmony import */ var _powersync_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @powersync/common */ "../common/dist/bundle.mjs");
19422
18241
  /* harmony import */ var async_mutex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! async-mutex */ "../../node_modules/async-mutex/index.mjs");
19423
- /* harmony import */ var _worker_db_opfs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../worker/db/opfs */ "./lib/src/worker/db/opfs.js");
19424
-
19425
18242
 
19426
18243
 
19427
18244
 
@@ -19504,10 +18321,12 @@ const DEFAULT_MODULE_FACTORIES = {
19504
18321
  else {
19505
18322
  module = await SyncWASQLiteModuleFactory();
19506
18323
  }
19507
- const vfs = await _worker_db_opfs__WEBPACK_IMPORTED_MODULE_3__.OPFSCoopSyncVFS.create(options.dbFileName, module);
18324
+ // @ts-expect-error The types for this static method are missing upstream
18325
+ const { OPFSCoopSyncVFS } = await __webpack_require__.e(/*! import() */ "node_modules_journeyapps_wa-sqlite_src_examples_OPFSCoopSyncVFS_js").then(__webpack_require__.bind(__webpack_require__, /*! @journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js */ "../../node_modules/@journeyapps/wa-sqlite/src/examples/OPFSCoopSyncVFS.js"));
18326
+ const vfs = await OPFSCoopSyncVFS.create(options.dbFileName, module);
19508
18327
  return {
19509
18328
  module,
19510
- vfs: vfs
18329
+ vfs
19511
18330
  };
19512
18331
  }
19513
18332
  };
@@ -19733,7 +18552,15 @@ class WASqliteConnection extends _powersync_common__WEBPACK_IMPORTED_MODULE_1__.
19733
18552
  }
19734
18553
  async close() {
19735
18554
  this.broadcastChannel?.close();
19736
- await this.sqliteAPI.close(this.dbP);
18555
+ await this.acquireExecuteLock(async () => {
18556
+ /**
18557
+ * Running the close operation inside the same execute mutex prevents errors like:
18558
+ * ```
18559
+ * unable to close due to unfinalized statements or unfinished backups
18560
+ * ```
18561
+ */
18562
+ await this.sqliteAPI.close(this.dbP);
18563
+ });
19737
18564
  }
19738
18565
  async registerOnTableChange(callback) {
19739
18566
  return this.registerListener({
@@ -19815,20 +18642,20 @@ class WASqliteConnection extends _powersync_common__WEBPACK_IMPORTED_MODULE_1__.
19815
18642
  }
19816
18643
 
19817
18644
 
19818
- /***/ }),
18645
+ /***/ },
19819
18646
 
19820
- /***/ "./lib/src/db/sync/WebRemote.js":
18647
+ /***/ "./lib/src/db/sync/WebRemote.js"
19821
18648
  /*!**************************************!*\
19822
18649
  !*** ./lib/src/db/sync/WebRemote.js ***!
19823
18650
  \**************************************/
19824
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18651
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
19825
18652
 
19826
18653
  __webpack_require__.r(__webpack_exports__);
19827
18654
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19828
18655
  /* harmony export */ WebRemote: () => (/* binding */ WebRemote)
19829
18656
  /* harmony export */ });
19830
18657
  /* harmony import */ var _powersync_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @powersync/common */ "../common/dist/bundle.mjs");
19831
- /* harmony import */ var _userAgent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./userAgent */ "./lib/src/db/sync/userAgent.js");
18658
+ /* harmony import */ var _userAgent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./userAgent.js */ "./lib/src/db/sync/userAgent.js");
19832
18659
 
19833
18660
 
19834
18661
  /*
@@ -19854,7 +18681,7 @@ class WebRemote extends _powersync_common__WEBPACK_IMPORTED_MODULE_0__.AbstractR
19854
18681
  getUserAgent() {
19855
18682
  let ua = [super.getUserAgent(), `powersync-web`];
19856
18683
  try {
19857
- ua.push(...(0,_userAgent__WEBPACK_IMPORTED_MODULE_1__.getUserAgentInfo)());
18684
+ ua.push(...(0,_userAgent_js__WEBPACK_IMPORTED_MODULE_1__.getUserAgentInfo)());
19858
18685
  }
19859
18686
  catch (e) {
19860
18687
  this.logger.warn('Failed to get user agent info', e);
@@ -19875,20 +18702,20 @@ class WebRemote extends _powersync_common__WEBPACK_IMPORTED_MODULE_0__.AbstractR
19875
18702
  }
19876
18703
 
19877
18704
 
19878
- /***/ }),
18705
+ /***/ },
19879
18706
 
19880
- /***/ "./lib/src/db/sync/WebStreamingSyncImplementation.js":
18707
+ /***/ "./lib/src/db/sync/WebStreamingSyncImplementation.js"
19881
18708
  /*!***********************************************************!*\
19882
18709
  !*** ./lib/src/db/sync/WebStreamingSyncImplementation.js ***!
19883
18710
  \***********************************************************/
19884
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18711
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
19885
18712
 
19886
18713
  __webpack_require__.r(__webpack_exports__);
19887
18714
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19888
18715
  /* harmony export */ WebStreamingSyncImplementation: () => (/* binding */ WebStreamingSyncImplementation)
19889
18716
  /* harmony export */ });
19890
18717
  /* harmony import */ var _powersync_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @powersync/common */ "../common/dist/bundle.mjs");
19891
- /* harmony import */ var _shared_navigator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/navigator */ "./lib/src/shared/navigator.js");
18718
+ /* harmony import */ var _shared_navigator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/navigator.js */ "./lib/src/shared/navigator.js");
19892
18719
 
19893
18720
 
19894
18721
  class WebStreamingSyncImplementation extends _powersync_common__WEBPACK_IMPORTED_MODULE_0__.AbstractStreamingSyncImplementation {
@@ -19904,18 +18731,18 @@ class WebStreamingSyncImplementation extends _powersync_common__WEBPACK_IMPORTED
19904
18731
  if (lockOptions.type == _powersync_common__WEBPACK_IMPORTED_MODULE_0__.LockType.SYNC) {
19905
18732
  this.logger.debug('requesting lock for ', identifier);
19906
18733
  }
19907
- return (0,_shared_navigator__WEBPACK_IMPORTED_MODULE_1__.getNavigatorLocks)().request(identifier, { signal: lockOptions.signal }, lockOptions.callback);
18734
+ return (0,_shared_navigator_js__WEBPACK_IMPORTED_MODULE_1__.getNavigatorLocks)().request(identifier, { signal: lockOptions.signal }, lockOptions.callback);
19908
18735
  }
19909
18736
  }
19910
18737
 
19911
18738
 
19912
- /***/ }),
18739
+ /***/ },
19913
18740
 
19914
- /***/ "./lib/src/db/sync/userAgent.js":
18741
+ /***/ "./lib/src/db/sync/userAgent.js"
19915
18742
  /*!**************************************!*\
19916
18743
  !*** ./lib/src/db/sync/userAgent.js ***!
19917
18744
  \**************************************/
19918
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18745
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
19919
18746
 
19920
18747
  __webpack_require__.r(__webpack_exports__);
19921
18748
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -19987,13 +18814,13 @@ function getOsInfo(nav) {
19987
18814
  }
19988
18815
 
19989
18816
 
19990
- /***/ }),
18817
+ /***/ },
19991
18818
 
19992
- /***/ "./lib/src/shared/navigator.js":
18819
+ /***/ "./lib/src/shared/navigator.js"
19993
18820
  /*!*************************************!*\
19994
18821
  !*** ./lib/src/shared/navigator.js ***!
19995
18822
  \*************************************/
19996
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18823
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
19997
18824
 
19998
18825
  __webpack_require__.r(__webpack_exports__);
19999
18826
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -20007,611 +18834,13 @@ const getNavigatorLocks = () => {
20007
18834
  };
20008
18835
 
20009
18836
 
20010
- /***/ }),
20011
-
20012
- /***/ "./lib/src/worker/db/opfs.js":
20013
- /*!***********************************!*\
20014
- !*** ./lib/src/worker/db/opfs.js ***!
20015
- \***********************************/
20016
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
20017
-
20018
- __webpack_require__.r(__webpack_exports__);
20019
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20020
- /* harmony export */ OPFSCoopSyncVFS: () => (/* binding */ OPFSCoopSyncVFS)
20021
- /* harmony export */ });
20022
- /* harmony import */ var _journeyapps_wa_sqlite_src_FacadeVFS_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @journeyapps/wa-sqlite/src/FacadeVFS.js */ "../../node_modules/@journeyapps/wa-sqlite/src/FacadeVFS.js");
20023
- /* harmony import */ var _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @journeyapps/wa-sqlite/src/VFS.js */ "../../node_modules/@journeyapps/wa-sqlite/src/VFS.js");
20024
- // Copyright 2024 Roy T. Hashimoto. All Rights Reserved.
20025
- // @ts-nocheck
20026
-
20027
-
20028
- const DEFAULT_TEMPORARY_FILES = 10;
20029
- const LOCK_NOTIFY_INTERVAL = 1000;
20030
- const DB_RELATED_FILE_SUFFIXES = ['', '-journal', '-wal'];
20031
- const finalizationRegistry = new FinalizationRegistry((releaser) => releaser());
20032
- class File {
20033
- /** @type {string} */ path;
20034
- /** @type {number} */ flags;
20035
- /** @type {FileSystemSyncAccessHandle} */ accessHandle;
20036
- /** @type {PersistentFile?} */ persistentFile;
20037
- constructor(path, flags) {
20038
- this.path = path;
20039
- this.flags = flags;
20040
- }
20041
- }
20042
- class PersistentFile {
20043
- /** @type {FileSystemFileHandle} */ fileHandle;
20044
- /** @type {FileSystemSyncAccessHandle} */ accessHandle = null;
20045
- // The following properties are for main database files.
20046
- /** @type {boolean} */ isLockBusy = false;
20047
- /** @type {boolean} */ isFileLocked = false;
20048
- /** @type {boolean} */ isRequestInProgress = false;
20049
- /** @type {function} */ handleLockReleaser = null;
20050
- /** @type {BroadcastChannel} */ handleRequestChannel;
20051
- /** @type {boolean} */ isHandleRequested = false;
20052
- constructor(fileHandle) {
20053
- this.fileHandle = fileHandle;
20054
- }
20055
- }
20056
- class OPFSCoopSyncVFS extends _journeyapps_wa_sqlite_src_FacadeVFS_js__WEBPACK_IMPORTED_MODULE_0__.FacadeVFS {
20057
- /** @type {Map<number, File>} */ mapIdToFile = new Map();
20058
- lastError = null;
20059
- log = null; //function(...args) { console.log(`[${contextName}]`, ...args) };
20060
- /** @type {Map<string, PersistentFile>} */ persistentFiles = new Map();
20061
- /** @type {Map<string, FileSystemSyncAccessHandle>} */ boundAccessHandles = new Map();
20062
- /** @type {Set<FileSystemSyncAccessHandle>} */ unboundAccessHandles = new Set();
20063
- /** @type {Set<string>} */ accessiblePaths = new Set();
20064
- releaser = null;
20065
- static async create(name, module) {
20066
- const vfs = new OPFSCoopSyncVFS(name, module);
20067
- await Promise.all([vfs.isReady(), vfs.#initialize(DEFAULT_TEMPORARY_FILES)]);
20068
- return vfs;
20069
- }
20070
- constructor(name, module) {
20071
- super(name, module);
20072
- }
20073
- async #initialize(nTemporaryFiles) {
20074
- // Delete temporary directories no longer in use.
20075
- const root = await navigator.storage.getDirectory();
20076
- // @ts-ignore
20077
- for await (const entry of root.values()) {
20078
- if (entry.kind === 'directory' && entry.name.startsWith('.ahp-')) {
20079
- // A lock with the same name as the directory protects it from
20080
- // being deleted.
20081
- await navigator.locks.request(entry.name, { ifAvailable: true }, async (lock) => {
20082
- if (lock) {
20083
- this.log?.(`Deleting temporary directory ${entry.name}`);
20084
- await root.removeEntry(entry.name, { recursive: true });
20085
- }
20086
- else {
20087
- this.log?.(`Temporary directory ${entry.name} is in use`);
20088
- }
20089
- });
20090
- }
20091
- }
20092
- // Create our temporary directory.
20093
- const tmpDirName = `.ahp-${Math.random().toString(36).slice(2)}`;
20094
- this.releaser = await new Promise((resolve) => {
20095
- navigator.locks.request(tmpDirName, () => {
20096
- return new Promise((release) => {
20097
- resolve(release);
20098
- });
20099
- });
20100
- });
20101
- const releaseHandle = async () => {
20102
- await Promise.all(this.persistentFiles.values().map(async (file) => {
20103
- try {
20104
- await this.#releaseAccessHandle(file);
20105
- }
20106
- catch (e) {
20107
- this.log?.('error releasing access handle', e);
20108
- }
20109
- finally {
20110
- release();
20111
- }
20112
- }));
20113
- };
20114
- finalizationRegistry.register(this, releaseHandle);
20115
- finalizationRegistry.register(this, this.releaser);
20116
- const tmpDir = await root.getDirectoryHandle(tmpDirName, { create: true });
20117
- // Populate temporary directory.
20118
- for (let i = 0; i < nTemporaryFiles; i++) {
20119
- const tmpFile = await tmpDir.getFileHandle(`${i}.tmp`, { create: true });
20120
- const tmpAccessHandle = await tmpFile.createSyncAccessHandle();
20121
- this.unboundAccessHandles.add(tmpAccessHandle);
20122
- }
20123
- }
20124
- /**
20125
- * @param {string?} zName
20126
- * @param {number} fileId
20127
- * @param {number} flags
20128
- * @param {DataView} pOutFlags
20129
- * @returns {number}
20130
- */
20131
- jOpen(zName, fileId, flags, pOutFlags) {
20132
- try {
20133
- const url = new URL(zName || Math.random().toString(36).slice(2), 'file://');
20134
- const path = url.pathname;
20135
- if (flags & _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OPEN_MAIN_DB) {
20136
- const persistentFile = this.persistentFiles.get(path);
20137
- if (persistentFile?.isRequestInProgress) {
20138
- // Should not reach here unless SQLite itself retries an open.
20139
- // Otherwise, asynchronous operations started on a previous
20140
- // open try should have completed.
20141
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_BUSY;
20142
- }
20143
- else if (!persistentFile) {
20144
- // This is the usual starting point for opening a database.
20145
- // Register a Promise that resolves when the database and related
20146
- // files are ready to be used.
20147
- this.log?.(`creating persistent file for ${path}`);
20148
- const create = !!(flags & _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OPEN_CREATE);
20149
- this._module.retryOps.push((async () => {
20150
- try {
20151
- // Get the path directory handle.
20152
- let dirHandle = await navigator.storage.getDirectory();
20153
- const directories = path.split('/').filter((d) => d);
20154
- const filename = directories.pop();
20155
- for (const directory of directories) {
20156
- dirHandle = await dirHandle.getDirectoryHandle(directory, { create });
20157
- }
20158
- // Get file handles for the database and related files,
20159
- // and create persistent file instances.
20160
- for (const suffix of DB_RELATED_FILE_SUFFIXES) {
20161
- const fileHandle = await dirHandle.getFileHandle(filename + suffix, { create });
20162
- await this.#createPersistentFile(fileHandle);
20163
- }
20164
- // Get access handles for the files.
20165
- const file = new File(path, flags);
20166
- file.persistentFile = this.persistentFiles.get(path);
20167
- await this.#requestAccessHandle(file);
20168
- }
20169
- catch (e) {
20170
- // Use an invalid persistent file to signal this error
20171
- // for the retried open.
20172
- const persistentFile = new PersistentFile(null);
20173
- this.persistentFiles.set(path, persistentFile);
20174
- console.error(e);
20175
- }
20176
- })());
20177
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_BUSY;
20178
- }
20179
- else if (!persistentFile.fileHandle) {
20180
- // The asynchronous open operation failed.
20181
- this.persistentFiles.delete(path);
20182
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_CANTOPEN;
20183
- }
20184
- else if (!persistentFile.accessHandle) {
20185
- // This branch is reached if the database was previously opened
20186
- // and closed.
20187
- this._module.retryOps.push((async () => {
20188
- const file = new File(path, flags);
20189
- file.persistentFile = this.persistentFiles.get(path);
20190
- await this.#requestAccessHandle(file);
20191
- })());
20192
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_BUSY;
20193
- }
20194
- }
20195
- if (!this.accessiblePaths.has(path) && !(flags & _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OPEN_CREATE)) {
20196
- throw new Error(`File ${path} not found`);
20197
- }
20198
- const file = new File(path, flags);
20199
- this.mapIdToFile.set(fileId, file);
20200
- if (this.persistentFiles.has(path)) {
20201
- file.persistentFile = this.persistentFiles.get(path);
20202
- }
20203
- else if (this.boundAccessHandles.has(path)) {
20204
- // This temporary file was previously created and closed. Reopen
20205
- // the same access handle.
20206
- file.accessHandle = this.boundAccessHandles.get(path);
20207
- }
20208
- else if (this.unboundAccessHandles.size) {
20209
- // Associate an unbound access handle to this file.
20210
- file.accessHandle = this.unboundAccessHandles.values().next().value;
20211
- file.accessHandle.truncate(0);
20212
- this.unboundAccessHandles.delete(file.accessHandle);
20213
- this.boundAccessHandles.set(path, file.accessHandle);
20214
- }
20215
- this.accessiblePaths.add(path);
20216
- pOutFlags.setInt32(0, flags, true);
20217
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OK;
20218
- }
20219
- catch (e) {
20220
- this.lastError = e;
20221
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_CANTOPEN;
20222
- }
20223
- }
20224
- /**
20225
- * @param {string} zName
20226
- * @param {number} syncDir
20227
- * @returns {number}
20228
- */
20229
- jDelete(zName, syncDir) {
20230
- try {
20231
- const url = new URL(zName, 'file://');
20232
- const path = url.pathname;
20233
- if (this.persistentFiles.has(path)) {
20234
- const persistentFile = this.persistentFiles.get(path);
20235
- persistentFile.accessHandle.truncate(0);
20236
- }
20237
- else {
20238
- this.boundAccessHandles.get(path)?.truncate(0);
20239
- }
20240
- this.accessiblePaths.delete(path);
20241
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OK;
20242
- }
20243
- catch (e) {
20244
- this.lastError = e;
20245
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_IOERR_DELETE;
20246
- }
20247
- }
20248
- /**
20249
- * @param {string} zName
20250
- * @param {number} flags
20251
- * @param {DataView} pResOut
20252
- * @returns {number}
20253
- */
20254
- jAccess(zName, flags, pResOut) {
20255
- try {
20256
- const url = new URL(zName, 'file://');
20257
- const path = url.pathname;
20258
- pResOut.setInt32(0, this.accessiblePaths.has(path) ? 1 : 0, true);
20259
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OK;
20260
- }
20261
- catch (e) {
20262
- this.lastError = e;
20263
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_IOERR_ACCESS;
20264
- }
20265
- }
20266
- /**
20267
- * @param {number} fileId
20268
- * @returns {number}
20269
- */
20270
- jClose(fileId) {
20271
- try {
20272
- const file = this.mapIdToFile.get(fileId);
20273
- this.mapIdToFile.delete(fileId);
20274
- if (file?.flags & _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OPEN_MAIN_DB) {
20275
- if (file.persistentFile?.accessHandle) {
20276
- this.#releaseAccessHandle(file);
20277
- }
20278
- }
20279
- else if (file?.flags & _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OPEN_DELETEONCLOSE) {
20280
- file.accessHandle.truncate(0);
20281
- this.accessiblePaths.delete(file.path);
20282
- if (!this.persistentFiles.has(file.path)) {
20283
- this.boundAccessHandles.delete(file.path);
20284
- this.unboundAccessHandles.add(file.accessHandle);
20285
- }
20286
- }
20287
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OK;
20288
- }
20289
- catch (e) {
20290
- this.lastError = e;
20291
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_IOERR_CLOSE;
20292
- }
20293
- }
20294
- /**
20295
- * @param {number} fileId
20296
- * @param {Uint8Array} pData
20297
- * @param {number} iOffset
20298
- * @returns {number}
20299
- */
20300
- jRead(fileId, pData, iOffset) {
20301
- try {
20302
- const file = this.mapIdToFile.get(fileId);
20303
- // On Chrome (at least), passing pData to accessHandle.read() is
20304
- // an error because pData is a Proxy of a Uint8Array. Calling
20305
- // subarray() produces a real Uint8Array and that works.
20306
- const accessHandle = file.accessHandle || file.persistentFile.accessHandle;
20307
- const bytesRead = accessHandle.read(pData.subarray(), { at: iOffset });
20308
- // Opening a database file performs one read without a xLock call.
20309
- if (file.flags & _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OPEN_MAIN_DB && !file.persistentFile.isFileLocked) {
20310
- this.#releaseAccessHandle(file);
20311
- }
20312
- if (bytesRead < pData.byteLength) {
20313
- pData.fill(0, bytesRead);
20314
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_IOERR_SHORT_READ;
20315
- }
20316
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OK;
20317
- }
20318
- catch (e) {
20319
- this.lastError = e;
20320
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_IOERR_READ;
20321
- }
20322
- }
20323
- /**
20324
- * @param {number} fileId
20325
- * @param {Uint8Array} pData
20326
- * @param {number} iOffset
20327
- * @returns {number}
20328
- */
20329
- jWrite(fileId, pData, iOffset) {
20330
- try {
20331
- const file = this.mapIdToFile.get(fileId);
20332
- // On Chrome (at least), passing pData to accessHandle.write() is
20333
- // an error because pData is a Proxy of a Uint8Array. Calling
20334
- // subarray() produces a real Uint8Array and that works.
20335
- const accessHandle = file.accessHandle || file.persistentFile.accessHandle;
20336
- const nBytes = accessHandle.write(pData.subarray(), { at: iOffset });
20337
- if (nBytes !== pData.byteLength)
20338
- throw new Error('short write');
20339
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OK;
20340
- }
20341
- catch (e) {
20342
- this.lastError = e;
20343
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_IOERR_WRITE;
20344
- }
20345
- }
20346
- /**
20347
- * @param {number} fileId
20348
- * @param {number} iSize
20349
- * @returns {number}
20350
- */
20351
- jTruncate(fileId, iSize) {
20352
- try {
20353
- const file = this.mapIdToFile.get(fileId);
20354
- const accessHandle = file.accessHandle || file.persistentFile.accessHandle;
20355
- accessHandle.truncate(iSize);
20356
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OK;
20357
- }
20358
- catch (e) {
20359
- this.lastError = e;
20360
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_IOERR_TRUNCATE;
20361
- }
20362
- }
20363
- /**
20364
- * @param {number} fileId
20365
- * @param {number} flags
20366
- * @returns {number}
20367
- */
20368
- jSync(fileId, flags) {
20369
- try {
20370
- const file = this.mapIdToFile.get(fileId);
20371
- const accessHandle = file.accessHandle || file.persistentFile.accessHandle;
20372
- accessHandle.flush();
20373
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OK;
20374
- }
20375
- catch (e) {
20376
- this.lastError = e;
20377
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_IOERR_FSYNC;
20378
- }
20379
- }
20380
- /**
20381
- * @param {number} fileId
20382
- * @param {DataView} pSize64
20383
- * @returns {number}
20384
- */
20385
- jFileSize(fileId, pSize64) {
20386
- try {
20387
- const file = this.mapIdToFile.get(fileId);
20388
- const accessHandle = file.accessHandle || file.persistentFile.accessHandle;
20389
- const size = accessHandle.getSize();
20390
- pSize64.setBigInt64(0, BigInt(size), true);
20391
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OK;
20392
- }
20393
- catch (e) {
20394
- this.lastError = e;
20395
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_IOERR_FSTAT;
20396
- }
20397
- }
20398
- /**
20399
- * @param {number} fileId
20400
- * @param {number} lockType
20401
- * @returns {number}
20402
- */
20403
- jLock(fileId, lockType) {
20404
- const file = this.mapIdToFile.get(fileId);
20405
- if (file.persistentFile.isRequestInProgress) {
20406
- file.persistentFile.isLockBusy = true;
20407
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_BUSY;
20408
- }
20409
- file.persistentFile.isFileLocked = true;
20410
- if (!file.persistentFile.handleLockReleaser) {
20411
- // Start listening for notifications from other connections.
20412
- // This is before we actually get access handles, but waiting to
20413
- // listen until then allows a race condition where notifications
20414
- // are missed.
20415
- file.persistentFile.handleRequestChannel.onmessage = () => {
20416
- this.log?.(`received notification for ${file.path}`);
20417
- if (file.persistentFile.isFileLocked) {
20418
- // We're still using the access handle, so mark it to be
20419
- // released when we're done.
20420
- file.persistentFile.isHandleRequested = true;
20421
- }
20422
- else {
20423
- // Release the access handles immediately.
20424
- this.#releaseAccessHandle(file);
20425
- }
20426
- file.persistentFile.handleRequestChannel.onmessage = null;
20427
- };
20428
- this.#requestAccessHandle(file);
20429
- this.log?.('returning SQLITE_BUSY');
20430
- file.persistentFile.isLockBusy = true;
20431
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_BUSY;
20432
- }
20433
- file.persistentFile.isLockBusy = false;
20434
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OK;
20435
- }
20436
- /**
20437
- * @param {number} fileId
20438
- * @param {number} lockType
20439
- * @returns {number}
20440
- */
20441
- jUnlock(fileId, lockType) {
20442
- const file = this.mapIdToFile.get(fileId);
20443
- if (lockType === _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_LOCK_NONE) {
20444
- // Don't change any state if this unlock is because xLock returned
20445
- // SQLITE_BUSY.
20446
- if (!file.persistentFile.isLockBusy) {
20447
- if (file.persistentFile.isHandleRequested) {
20448
- // Another connection wants the access handle.
20449
- this.#releaseAccessHandle(file);
20450
- file.persistentFile.isHandleRequested = false;
20451
- }
20452
- file.persistentFile.isFileLocked = false;
20453
- }
20454
- }
20455
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OK;
20456
- }
20457
- /**
20458
- * @param {number} fileId
20459
- * @param {number} op
20460
- * @param {DataView} pArg
20461
- * @returns {number|Promise<number>}
20462
- */
20463
- jFileControl(fileId, op, pArg) {
20464
- try {
20465
- const file = this.mapIdToFile.get(fileId);
20466
- switch (op) {
20467
- case _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_FCNTL_PRAGMA:
20468
- const key = extractString(pArg, 4);
20469
- const value = extractString(pArg, 8);
20470
- this.log?.('xFileControl', file.path, 'PRAGMA', key, value);
20471
- switch (key.toLowerCase()) {
20472
- case 'journal_mode':
20473
- if (value && !['off', 'memory', 'delete', 'wal'].includes(value.toLowerCase())) {
20474
- throw new Error('journal_mode must be "off", "memory", "delete", or "wal"');
20475
- }
20476
- break;
20477
- }
20478
- break;
20479
- }
20480
- }
20481
- catch (e) {
20482
- this.lastError = e;
20483
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_IOERR;
20484
- }
20485
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_NOTFOUND;
20486
- }
20487
- /**
20488
- * @param {Uint8Array} zBuf
20489
- * @returns
20490
- */
20491
- jGetLastError(zBuf) {
20492
- if (this.lastError) {
20493
- console.error(this.lastError);
20494
- const outputArray = zBuf.subarray(0, zBuf.byteLength - 1);
20495
- const { written } = new TextEncoder().encodeInto(this.lastError.message, outputArray);
20496
- zBuf[written] = 0;
20497
- }
20498
- return _journeyapps_wa_sqlite_src_VFS_js__WEBPACK_IMPORTED_MODULE_1__.SQLITE_OK;
20499
- }
20500
- /**
20501
- * @param {FileSystemFileHandle} fileHandle
20502
- * @returns {Promise<PersistentFile>}
20503
- */
20504
- async #createPersistentFile(fileHandle) {
20505
- const persistentFile = new PersistentFile(fileHandle);
20506
- const root = await navigator.storage.getDirectory();
20507
- const relativePath = await root.resolve(fileHandle);
20508
- const path = `/${relativePath.join('/')}`;
20509
- persistentFile.handleRequestChannel = new BroadcastChannel(`ahp:${path}`);
20510
- this.persistentFiles.set(path, persistentFile);
20511
- const f = await fileHandle.getFile();
20512
- if (f.size) {
20513
- this.accessiblePaths.add(path);
20514
- }
20515
- return persistentFile;
20516
- }
20517
- /**
20518
- * @param {File} file
20519
- */
20520
- #requestAccessHandle(file) {
20521
- console.assert(!file.persistentFile.handleLockReleaser);
20522
- if (!file.persistentFile.isRequestInProgress) {
20523
- file.persistentFile.isRequestInProgress = true;
20524
- this._module.retryOps.push((async () => {
20525
- // Acquire the Web Lock.
20526
- file.persistentFile.handleLockReleaser = await this.#acquireLock(file.persistentFile);
20527
- try {
20528
- // Get access handles for the database and releated files in parallel.
20529
- this.log?.(`creating access handles for ${file.path}`);
20530
- await Promise.all(DB_RELATED_FILE_SUFFIXES.map(async (suffix) => {
20531
- const persistentFile = this.persistentFiles.get(file.path + suffix);
20532
- if (persistentFile) {
20533
- persistentFile.accessHandle = await persistentFile.fileHandle.createSyncAccessHandle();
20534
- }
20535
- }));
20536
- }
20537
- catch (e) {
20538
- this.log?.(`failed to create access handles for ${file.path}`, e);
20539
- // Close any of the potentially opened access handles
20540
- DB_RELATED_FILE_SUFFIXES.forEach(async (suffix) => {
20541
- const persistentFile = this.persistentFiles.get(file.path + suffix);
20542
- if (persistentFile) {
20543
- persistentFile.accessHandle?.close();
20544
- }
20545
- });
20546
- // Release the lock, if we failed here, we'd need to obtain the lock later in order to retry
20547
- file.persistentFile.handleLockReleaser();
20548
- throw e;
20549
- }
20550
- finally {
20551
- file.persistentFile.isRequestInProgress = false;
20552
- }
20553
- })());
20554
- return this._module.retryOps.at(-1);
20555
- }
20556
- return Promise.resolve();
20557
- }
20558
- /**
20559
- * @param {File} file
20560
- */
20561
- async #releaseAccessHandle(file) {
20562
- DB_RELATED_FILE_SUFFIXES.forEach(async (suffix) => {
20563
- const persistentFile = this.persistentFiles.get(file.path + suffix);
20564
- if (persistentFile) {
20565
- persistentFile.accessHandle?.close();
20566
- persistentFile.accessHandle = null;
20567
- }
20568
- });
20569
- this.log?.(`access handles closed for ${file.path}`);
20570
- file.persistentFile.handleLockReleaser?.();
20571
- file.persistentFile.handleLockReleaser = null;
20572
- this.log?.(`lock released for ${file.path}`);
20573
- }
20574
- /**
20575
- * @param {PersistentFile} persistentFile
20576
- * @returns {Promise<function>} lock releaser
20577
- */
20578
- #acquireLock(persistentFile) {
20579
- return new Promise((resolve) => {
20580
- // Tell other connections we want the access handle.
20581
- const lockName = persistentFile.handleRequestChannel.name;
20582
- const notify = () => {
20583
- this.log?.(`notifying for ${lockName}`);
20584
- persistentFile.handleRequestChannel.postMessage(null);
20585
- };
20586
- const notifyId = setInterval(notify, LOCK_NOTIFY_INTERVAL);
20587
- setTimeout(notify);
20588
- this.log?.(`lock requested: ${lockName}`);
20589
- navigator.locks.request(lockName, (lock) => {
20590
- // We have the lock. Stop asking other connections for it.
20591
- this.log?.(`lock acquired: ${lockName}`, lock);
20592
- clearInterval(notifyId);
20593
- return new Promise(resolve);
20594
- });
20595
- });
20596
- }
20597
- }
20598
- function extractString(dataView, offset) {
20599
- const p = dataView.getUint32(offset, true);
20600
- if (p) {
20601
- const chars = new Uint8Array(dataView.buffer, p);
20602
- return new TextDecoder().decode(chars.subarray(0, chars.indexOf(0)));
20603
- }
20604
- return null;
20605
- }
20606
-
20607
-
20608
- /***/ }),
18837
+ /***/ },
20609
18838
 
20610
- /***/ "./lib/src/worker/sync/BroadcastLogger.js":
18839
+ /***/ "./lib/src/worker/sync/BroadcastLogger.js"
20611
18840
  /*!************************************************!*\
20612
18841
  !*** ./lib/src/worker/sync/BroadcastLogger.js ***!
20613
18842
  \************************************************/
20614
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18843
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
20615
18844
 
20616
18845
  __webpack_require__.r(__webpack_exports__);
20617
18846
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -20748,13 +18977,13 @@ class BroadcastLogger {
20748
18977
  }
20749
18978
 
20750
18979
 
20751
- /***/ }),
18980
+ /***/ },
20752
18981
 
20753
- /***/ "./lib/src/worker/sync/SharedSyncImplementation.js":
18982
+ /***/ "./lib/src/worker/sync/SharedSyncImplementation.js"
20754
18983
  /*!*********************************************************!*\
20755
18984
  !*** ./lib/src/worker/sync/SharedSyncImplementation.js ***!
20756
18985
  \*********************************************************/
20757
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18986
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
20758
18987
 
20759
18988
  __webpack_require__.r(__webpack_exports__);
20760
18989
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
@@ -20763,12 +18992,12 @@ __webpack_require__.r(__webpack_exports__);
20763
18992
  /* harmony export */ });
20764
18993
  /* harmony import */ var _powersync_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @powersync/common */ "../common/dist/bundle.mjs");
20765
18994
  /* harmony import */ var async_mutex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! async-mutex */ "../../node_modules/async-mutex/index.mjs");
20766
- /* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! comlink */ "../../node_modules/comlink/dist/esm/comlink.mjs");
20767
- /* harmony import */ var _db_sync_WebRemote__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../db/sync/WebRemote */ "./lib/src/db/sync/WebRemote.js");
20768
- /* harmony import */ var _db_sync_WebStreamingSyncImplementation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../db/sync/WebStreamingSyncImplementation */ "./lib/src/db/sync/WebStreamingSyncImplementation.js");
20769
- /* harmony import */ var _db_adapters_LockedAsyncDatabaseAdapter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../db/adapters/LockedAsyncDatabaseAdapter */ "./lib/src/db/adapters/LockedAsyncDatabaseAdapter.js");
20770
- /* harmony import */ var _db_adapters_WorkerWrappedAsyncDatabaseConnection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../db/adapters/WorkerWrappedAsyncDatabaseConnection */ "./lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js");
20771
- /* harmony import */ var _BroadcastLogger__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./BroadcastLogger */ "./lib/src/worker/sync/BroadcastLogger.js");
18995
+ /* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! comlink */ "../../node_modules/comlink/dist/esm/comlink.mjs");
18996
+ /* harmony import */ var _db_sync_WebRemote_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../db/sync/WebRemote.js */ "./lib/src/db/sync/WebRemote.js");
18997
+ /* harmony import */ var _db_sync_WebStreamingSyncImplementation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../db/sync/WebStreamingSyncImplementation.js */ "./lib/src/db/sync/WebStreamingSyncImplementation.js");
18998
+ /* harmony import */ var _db_adapters_LockedAsyncDatabaseAdapter_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../db/adapters/LockedAsyncDatabaseAdapter.js */ "./lib/src/db/adapters/LockedAsyncDatabaseAdapter.js");
18999
+ /* harmony import */ var _db_adapters_WorkerWrappedAsyncDatabaseConnection_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../db/adapters/WorkerWrappedAsyncDatabaseConnection.js */ "./lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js");
19000
+ /* harmony import */ var _BroadcastLogger_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./BroadcastLogger.js */ "./lib/src/worker/sync/BroadcastLogger.js");
20772
19001
 
20773
19002
 
20774
19003
 
@@ -20833,7 +19062,7 @@ class SharedSyncImplementation extends _powersync_common__WEBPACK_IMPORTED_MODUL
20833
19062
  // Should be configured once we get params
20834
19063
  this.distributedDB = null;
20835
19064
  this.syncStatus = new _powersync_common__WEBPACK_IMPORTED_MODULE_0__.SyncStatus({});
20836
- this.broadCastLogger = new _BroadcastLogger__WEBPACK_IMPORTED_MODULE_6__.BroadcastLogger(this.ports);
19065
+ this.broadCastLogger = new _BroadcastLogger_js__WEBPACK_IMPORTED_MODULE_7__.BroadcastLogger(this.ports);
20837
19066
  this.connectionManager = new _powersync_common__WEBPACK_IMPORTED_MODULE_0__.ConnectionManager({
20838
19067
  createSyncImplementation: async () => {
20839
19068
  await this.waitForReady();
@@ -20877,7 +19106,8 @@ class SharedSyncImplementation extends _powersync_common__WEBPACK_IMPORTED_MODUL
20877
19106
  */
20878
19107
  async getRandomWrappedPort() {
20879
19108
  return await this.portMutex.runExclusive(() => {
20880
- return this.ports[Math.floor(Math.random() * this.ports.length)];
19109
+ const nonClosingPorts = this.ports.filter((p) => !p.isClosing);
19110
+ return nonClosingPorts[Math.floor(Math.random() * nonClosingPorts.length)];
20881
19111
  });
20882
19112
  }
20883
19113
  async waitForStatus(status) {
@@ -20930,7 +19160,7 @@ class SharedSyncImplementation extends _powersync_common__WEBPACK_IMPORTED_MODUL
20930
19160
  if (params.streamOptions?.flags?.broadcastLogs) {
20931
19161
  this.logger = this.broadCastLogger;
20932
19162
  }
20933
- const lockedAdapter = new _db_adapters_LockedAsyncDatabaseAdapter__WEBPACK_IMPORTED_MODULE_4__.LockedAsyncDatabaseAdapter({
19163
+ const lockedAdapter = new _db_adapters_LockedAsyncDatabaseAdapter_js__WEBPACK_IMPORTED_MODULE_5__.LockedAsyncDatabaseAdapter({
20934
19164
  name: params.dbParams.dbFilename,
20935
19165
  openConnection: async () => {
20936
19166
  // Gets a connection from the clients when a new connection is requested.
@@ -20952,6 +19182,14 @@ class SharedSyncImplementation extends _powersync_common__WEBPACK_IMPORTED_MODUL
20952
19182
  // We may have missed some table updates while the database was closed.
20953
19183
  // We can poke the crud in case we missed any updates.
20954
19184
  this.connectionManager.syncStreamImplementation?.triggerCrudUpload();
19185
+ /**
19186
+ * FIXME or IMPROVE ME
19187
+ * The Rust client implementation stores sync state on the connection level.
19188
+ * Reopening the database causes a state machine error which should cause the
19189
+ * StreamingSyncImplementation to reconnect. It would be nicer if we could trigger
19190
+ * this reconnect earlier.
19191
+ * This reconnect is not required for IndexedDB.
19192
+ */
20955
19193
  }
20956
19194
  });
20957
19195
  self.onerror = (event) => {
@@ -20985,7 +19223,7 @@ class SharedSyncImplementation extends _powersync_common__WEBPACK_IMPORTED_MODUL
20985
19223
  return await this.portMutex.runExclusive(() => {
20986
19224
  const portProvider = {
20987
19225
  port,
20988
- clientProvider: comlink__WEBPACK_IMPORTED_MODULE_7__.wrap(port),
19226
+ clientProvider: comlink__WEBPACK_IMPORTED_MODULE_2__.wrap(port),
20989
19227
  currentSubscriptions: [],
20990
19228
  closeListeners: [],
20991
19229
  isClosing: false
@@ -21032,7 +19270,7 @@ class SharedSyncImplementation extends _powersync_common__WEBPACK_IMPORTED_MODUL
21032
19270
  await closeListener();
21033
19271
  }
21034
19272
  this.collectActiveSubscriptions();
21035
- return () => trackedPort.clientProvider[comlink__WEBPACK_IMPORTED_MODULE_7__.releaseProxy]();
19273
+ return () => trackedPort.clientProvider[comlink__WEBPACK_IMPORTED_MODULE_2__.releaseProxy]();
21036
19274
  });
21037
19275
  }
21038
19276
  triggerCrudUpload() {
@@ -21069,9 +19307,9 @@ class SharedSyncImplementation extends _powersync_common__WEBPACK_IMPORTED_MODUL
21069
19307
  // This should only be called after initialization has completed
21070
19308
  const syncParams = this.syncParams;
21071
19309
  // Create a new StreamingSyncImplementation for each connect call. This is usually done is all SDKs.
21072
- return new _db_sync_WebStreamingSyncImplementation__WEBPACK_IMPORTED_MODULE_3__.WebStreamingSyncImplementation({
19310
+ return new _db_sync_WebStreamingSyncImplementation_js__WEBPACK_IMPORTED_MODULE_4__.WebStreamingSyncImplementation({
21073
19311
  adapter: new _powersync_common__WEBPACK_IMPORTED_MODULE_0__.SqliteBucketStorage(this.distributedDB, this.logger),
21074
- remote: new _db_sync_WebRemote__WEBPACK_IMPORTED_MODULE_2__.WebRemote({
19312
+ remote: new _db_sync_WebRemote_js__WEBPACK_IMPORTED_MODULE_3__.WebRemote({
21075
19313
  invalidateCredentials: async () => {
21076
19314
  const lastPort = await this.getLastWrappedPort();
21077
19315
  if (!lastPort) {
@@ -21144,85 +19382,77 @@ class SharedSyncImplementation extends _powersync_common__WEBPACK_IMPORTED_MODUL
21144
19382
  * Opens a worker wrapped database connection. Using the last connected client port.
21145
19383
  */
21146
19384
  async openInternalDB() {
21147
- while (true) {
21148
- try {
21149
- const client = await this.getRandomWrappedPort();
21150
- if (!client) {
21151
- // Should not really happen in practice
21152
- throw new Error(`Could not open DB connection since no client is connected.`);
21153
- }
21154
- // Fail-safe timeout for opening a database connection.
21155
- const timeout = setTimeout(() => {
21156
- abortController.abort();
21157
- }, 10_000);
21158
- /**
21159
- * Handle cases where the client might close while opening a connection.
21160
- */
21161
- const abortController = new AbortController();
21162
- const closeListener = () => {
21163
- abortController.abort();
21164
- };
21165
- const removeCloseListener = () => {
21166
- const index = client.closeListeners.indexOf(closeListener);
21167
- if (index >= 0) {
21168
- client.closeListeners.splice(index, 1);
21169
- }
21170
- };
21171
- client.closeListeners.push(closeListener);
21172
- const workerPort = await withAbort({
21173
- action: () => client.clientProvider.getDBWorkerPort(),
21174
- signal: abortController.signal,
21175
- cleanupOnAbort: (port) => {
21176
- port.close();
21177
- }
21178
- }).catch((ex) => {
21179
- removeCloseListener();
21180
- throw ex;
21181
- });
21182
- const remote = comlink__WEBPACK_IMPORTED_MODULE_7__.wrap(workerPort);
21183
- const identifier = this.syncParams.dbParams.dbFilename;
21184
- /**
21185
- * The open could fail if the tab is closed while we're busy opening the database.
21186
- * This operation is typically executed inside an exclusive portMutex lock.
21187
- * We typically execute the closeListeners using the portMutex in a different context.
21188
- * We can't rely on the closeListeners to abort the operation if the tab is closed.
21189
- */
21190
- const db = await withAbort({
21191
- action: () => remote(this.syncParams.dbParams),
21192
- signal: abortController.signal,
21193
- cleanupOnAbort: (db) => {
21194
- db.close();
21195
- }
21196
- }).finally(() => {
21197
- // We can remove the close listener here since we no longer need it past this point.
21198
- removeCloseListener();
21199
- });
21200
- clearTimeout(timeout);
21201
- const wrapped = new _db_adapters_WorkerWrappedAsyncDatabaseConnection__WEBPACK_IMPORTED_MODULE_5__.WorkerWrappedAsyncDatabaseConnection({
21202
- remote,
21203
- baseConnection: db,
21204
- identifier,
21205
- // It's possible for this worker to outlive the client hosting the database for us. We need to be prepared for
21206
- // that and ensure pending requests are aborted when the tab is closed.
21207
- remoteCanCloseUnexpectedly: true
21208
- });
21209
- client.closeListeners.push(async () => {
21210
- this.logger.info('Aborting open connection because associated tab closed.');
21211
- /**
21212
- * Don't await this close operation. It might never resolve if the tab is closed.
21213
- * We mark the remote as closed first, this will reject any pending requests.
21214
- * We then call close. The close operation is configured to fire-and-forget, the main promise will reject immediately.
21215
- */
21216
- wrapped.markRemoteClosed();
21217
- wrapped.close().catch((ex) => this.logger.warn('error closing database connection', ex));
21218
- });
21219
- return wrapped;
19385
+ const client = await this.getRandomWrappedPort();
19386
+ if (!client) {
19387
+ // Should not really happen in practice
19388
+ throw new Error(`Could not open DB connection since no client is connected.`);
19389
+ }
19390
+ // Fail-safe timeout for opening a database connection.
19391
+ const timeout = setTimeout(() => {
19392
+ abortController.abort();
19393
+ }, 10_000);
19394
+ /**
19395
+ * Handle cases where the client might close while opening a connection.
19396
+ */
19397
+ const abortController = new AbortController();
19398
+ const closeListener = () => {
19399
+ abortController.abort();
19400
+ };
19401
+ const removeCloseListener = () => {
19402
+ const index = client.closeListeners.indexOf(closeListener);
19403
+ if (index >= 0) {
19404
+ client.closeListeners.splice(index, 1);
21220
19405
  }
21221
- catch (ex) {
21222
- this.logger.warn('Error opening internal DB', ex);
21223
- await new Promise((resolve) => setTimeout(resolve, 1000));
19406
+ };
19407
+ client.closeListeners.push(closeListener);
19408
+ const workerPort = await withAbort({
19409
+ action: () => client.clientProvider.getDBWorkerPort(),
19410
+ signal: abortController.signal,
19411
+ cleanupOnAbort: (port) => {
19412
+ port.close();
21224
19413
  }
21225
- }
19414
+ }).catch((ex) => {
19415
+ removeCloseListener();
19416
+ throw ex;
19417
+ });
19418
+ const remote = comlink__WEBPACK_IMPORTED_MODULE_2__.wrap(workerPort);
19419
+ const identifier = this.syncParams.dbParams.dbFilename;
19420
+ /**
19421
+ * The open could fail if the tab is closed while we're busy opening the database.
19422
+ * This operation is typically executed inside an exclusive portMutex lock.
19423
+ * We typically execute the closeListeners using the portMutex in a different context.
19424
+ * We can't rely on the closeListeners to abort the operation if the tab is closed.
19425
+ */
19426
+ const db = await withAbort({
19427
+ action: () => remote(this.syncParams.dbParams),
19428
+ signal: abortController.signal,
19429
+ cleanupOnAbort: (db) => {
19430
+ db.close();
19431
+ }
19432
+ }).finally(() => {
19433
+ // We can remove the close listener here since we no longer need it past this point.
19434
+ removeCloseListener();
19435
+ });
19436
+ clearTimeout(timeout);
19437
+ const wrapped = new _db_adapters_WorkerWrappedAsyncDatabaseConnection_js__WEBPACK_IMPORTED_MODULE_6__.WorkerWrappedAsyncDatabaseConnection({
19438
+ remote,
19439
+ baseConnection: db,
19440
+ identifier,
19441
+ // It's possible for this worker to outlive the client hosting the database for us. We need to be prepared for
19442
+ // that and ensure pending requests are aborted when the tab is closed.
19443
+ remoteCanCloseUnexpectedly: true
19444
+ });
19445
+ client.closeListeners.push(async () => {
19446
+ this.logger.info('Aborting open connection because associated tab closed.');
19447
+ /**
19448
+ * Don't await this close operation. It might never resolve if the tab is closed.
19449
+ * We mark the remote as closed first, this will reject any pending requests.
19450
+ * We then call close. The close operation is configured to fire-and-forget, the main promise will reject immediately.
19451
+ */
19452
+ wrapped.markRemoteClosed();
19453
+ wrapped.close().catch((ex) => this.logger.warn('error closing database connection', ex));
19454
+ });
19455
+ return wrapped;
21226
19456
  }
21227
19457
  /**
21228
19458
  * A method to update the all shared statuses for each
@@ -21265,21 +19495,21 @@ function withAbort(options) {
21265
19495
  }
21266
19496
 
21267
19497
 
21268
- /***/ }),
19498
+ /***/ },
21269
19499
 
21270
- /***/ "./lib/src/worker/sync/WorkerClient.js":
19500
+ /***/ "./lib/src/worker/sync/WorkerClient.js"
21271
19501
  /*!*********************************************!*\
21272
19502
  !*** ./lib/src/worker/sync/WorkerClient.js ***!
21273
19503
  \*********************************************/
21274
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
19504
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
21275
19505
 
21276
19506
  __webpack_require__.r(__webpack_exports__);
21277
19507
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
21278
19508
  /* harmony export */ WorkerClient: () => (/* binding */ WorkerClient)
21279
19509
  /* harmony export */ });
21280
- /* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! comlink */ "../../node_modules/comlink/dist/esm/comlink.mjs");
21281
- /* harmony import */ var _shared_navigator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../shared/navigator */ "./lib/src/shared/navigator.js");
21282
- /* harmony import */ var _SharedSyncImplementation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SharedSyncImplementation */ "./lib/src/worker/sync/SharedSyncImplementation.js");
19510
+ /* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! comlink */ "../../node_modules/comlink/dist/esm/comlink.mjs");
19511
+ /* harmony import */ var _shared_navigator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../shared/navigator.js */ "./lib/src/shared/navigator.js");
19512
+ /* harmony import */ var _SharedSyncImplementation_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SharedSyncImplementation.js */ "./lib/src/worker/sync/SharedSyncImplementation.js");
21283
19513
 
21284
19514
 
21285
19515
 
@@ -21297,14 +19527,14 @@ class WorkerClient {
21297
19527
  constructor(sync, port) {
21298
19528
  this.sync = sync;
21299
19529
  this.port = port;
21300
- comlink__WEBPACK_IMPORTED_MODULE_2__.expose(this, this.port);
19530
+ comlink__WEBPACK_IMPORTED_MODULE_0__.expose(this, this.port);
21301
19531
  /**
21302
19532
  * Adds an extra listener which can remove this port
21303
19533
  * from the list of monitored ports.
21304
19534
  */
21305
19535
  this.port.addEventListener('message', async (event) => {
21306
19536
  const payload = event.data;
21307
- if (payload?.event == _SharedSyncImplementation__WEBPACK_IMPORTED_MODULE_1__.SharedSyncClientEvent.CLOSE_CLIENT) {
19537
+ if (payload?.event == _SharedSyncImplementation_js__WEBPACK_IMPORTED_MODULE_2__.SharedSyncClientEvent.CLOSE_CLIENT) {
21308
19538
  await this.removePort();
21309
19539
  }
21310
19540
  });
@@ -21316,7 +19546,7 @@ class WorkerClient {
21316
19546
  const release = await this.sync.removePort(resolved);
21317
19547
  this.resolvedPort = null;
21318
19548
  this.port.postMessage({
21319
- event: _SharedSyncImplementation__WEBPACK_IMPORTED_MODULE_1__.SharedSyncClientEvent.CLOSE_ACK,
19549
+ event: _SharedSyncImplementation_js__WEBPACK_IMPORTED_MODULE_2__.SharedSyncClientEvent.CLOSE_ACK,
21320
19550
  data: {}
21321
19551
  });
21322
19552
  release?.();
@@ -21332,7 +19562,7 @@ class WorkerClient {
21332
19562
  // Only add the port once the lock has been obtained on the client.
21333
19563
  this.resolvedPort = await this.sync.addPort(this.port);
21334
19564
  // Don't await this lock request
21335
- (0,_shared_navigator__WEBPACK_IMPORTED_MODULE_0__.getNavigatorLocks)().request(name, async () => {
19565
+ (0,_shared_navigator_js__WEBPACK_IMPORTED_MODULE_1__.getNavigatorLocks)().request(name, async () => {
21336
19566
  await this.removePort();
21337
19567
  });
21338
19568
  }
@@ -21366,7 +19596,7 @@ class WorkerClient {
21366
19596
  }
21367
19597
 
21368
19598
 
21369
- /***/ })
19599
+ /***/ }
21370
19600
 
21371
19601
  /******/ });
21372
19602
  /************************************************************************/
@@ -21380,6 +19610,12 @@ class WorkerClient {
21380
19610
  /******/ if (cachedModule !== undefined) {
21381
19611
  /******/ return cachedModule.exports;
21382
19612
  /******/ }
19613
+ /******/ // Check if module exists (development only)
19614
+ /******/ if (__webpack_modules__[moduleId] === undefined) {
19615
+ /******/ var e = new Error("Cannot find module '" + moduleId + "'");
19616
+ /******/ e.code = 'MODULE_NOT_FOUND';
19617
+ /******/ throw e;
19618
+ /******/ }
21383
19619
  /******/ // Create a new module (and put it into the cache)
21384
19620
  /******/ var module = __webpack_module_cache__[moduleId] = {
21385
19621
  /******/ // no module.id needed
@@ -21533,18 +19769,18 @@ var __webpack_exports__ = {};
21533
19769
  \****************************************************************/
21534
19770
  __webpack_require__.r(__webpack_exports__);
21535
19771
  /* harmony import */ var _powersync_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @powersync/common */ "../common/dist/bundle.mjs");
21536
- /* harmony import */ var _SharedSyncImplementation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SharedSyncImplementation */ "./lib/src/worker/sync/SharedSyncImplementation.js");
21537
- /* harmony import */ var _WorkerClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./WorkerClient */ "./lib/src/worker/sync/WorkerClient.js");
19772
+ /* harmony import */ var _SharedSyncImplementation_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SharedSyncImplementation.js */ "./lib/src/worker/sync/SharedSyncImplementation.js");
19773
+ /* harmony import */ var _WorkerClient_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./WorkerClient.js */ "./lib/src/worker/sync/WorkerClient.js");
21538
19774
 
21539
19775
 
21540
19776
 
21541
19777
  const _self = self;
21542
19778
  const logger = (0,_powersync_common__WEBPACK_IMPORTED_MODULE_0__.createBaseLogger)();
21543
19779
  logger.useDefaults();
21544
- const sharedSyncImplementation = new _SharedSyncImplementation__WEBPACK_IMPORTED_MODULE_1__.SharedSyncImplementation();
19780
+ const sharedSyncImplementation = new _SharedSyncImplementation_js__WEBPACK_IMPORTED_MODULE_1__.SharedSyncImplementation();
21545
19781
  _self.onconnect = async function (event) {
21546
19782
  const port = event.ports[0];
21547
- new _WorkerClient__WEBPACK_IMPORTED_MODULE_2__.WorkerClient(sharedSyncImplementation, port);
19783
+ new _WorkerClient_js__WEBPACK_IMPORTED_MODULE_2__.WorkerClient(sharedSyncImplementation, port);
21548
19784
  };
21549
19785
 
21550
19786
  })();