@powersync/web 0.0.0-dev-20251119150914 → 0.0.0-dev-20251120085122
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.
- package/dist/index.umd.js +21 -6
- package/dist/index.umd.js.map +1 -1
- package/dist/worker/SharedSyncImplementation.umd.js +14 -6
- package/dist/worker/SharedSyncImplementation.umd.js.map +1 -1
- package/dist/worker/WASQLiteDB.umd.js +25 -28
- package/dist/worker/WASQLiteDB.umd.js.map +1 -1
- package/lib/src/db/adapters/AsyncDatabaseConnection.d.ts +5 -0
- package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.d.ts +1 -0
- package/lib/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.js +7 -2
- package/lib/src/db/adapters/wa-sqlite/WASQLiteConnection.d.ts +5 -0
- package/lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js +7 -0
- package/lib/src/worker/db/SharedWASQLiteConnection.d.ts +4 -3
- package/lib/src/worker/db/SharedWASQLiteConnection.js +14 -11
- package/lib/src/worker/db/WASQLiteDB.worker.js +2 -2
- package/lib/src/worker/db/WorkerWASQLiteConnection.d.ts +3 -3
- package/lib/src/worker/db/WorkerWASQLiteConnection.js +2 -14
- package/lib/src/worker/sync/SharedSyncImplementation.d.ts +2 -2
- package/lib/src/worker/sync/SharedSyncImplementation.js +7 -4
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/db/adapters/AsyncDatabaseConnection.ts +5 -0
- package/src/db/adapters/WorkerWrappedAsyncDatabaseConnection.ts +8 -2
- package/src/db/adapters/wa-sqlite/WASQLiteConnection.ts +8 -0
- package/src/worker/db/SharedWASQLiteConnection.ts +18 -14
- package/src/worker/db/WASQLiteDB.worker.ts +2 -2
- package/src/worker/db/WorkerWASQLiteConnection.ts +3 -18
- package/src/worker/sync/SharedSyncImplementation.ts +15 -12
|
@@ -15947,6 +15947,13 @@ class WASqliteConnection extends _powersync_common__WEBPACK_IMPORTED_MODULE_1__.
|
|
|
15947
15947
|
}
|
|
15948
15948
|
return this._dbP;
|
|
15949
15949
|
}
|
|
15950
|
+
/**
|
|
15951
|
+
* Checks if the database connection is in autocommit mode.
|
|
15952
|
+
* @returns true if in autocommit mode, false if in a transaction
|
|
15953
|
+
*/
|
|
15954
|
+
async isAutoCommit() {
|
|
15955
|
+
return this.sqliteAPI.get_autocommit(this.dbP) != 0;
|
|
15956
|
+
}
|
|
15950
15957
|
async markHold() {
|
|
15951
15958
|
const previousHoldId = this._holdId;
|
|
15952
15959
|
this._holdId = `${++this._holdCounter}`;
|
|
@@ -16238,6 +16245,18 @@ class SharedWASQLiteConnection {
|
|
|
16238
16245
|
this.isClosing = false;
|
|
16239
16246
|
this.activeHoldId = null;
|
|
16240
16247
|
}
|
|
16248
|
+
get logger() {
|
|
16249
|
+
return this.options.logger;
|
|
16250
|
+
}
|
|
16251
|
+
get dbEntry() {
|
|
16252
|
+
return this.options.dbMap.get(this.options.dbFilename);
|
|
16253
|
+
}
|
|
16254
|
+
get connection() {
|
|
16255
|
+
return this.dbEntry.db;
|
|
16256
|
+
}
|
|
16257
|
+
get clientIds() {
|
|
16258
|
+
return this.dbEntry.clientIds;
|
|
16259
|
+
}
|
|
16241
16260
|
async init() {
|
|
16242
16261
|
// No-op since the connection is already initialized when it was created
|
|
16243
16262
|
}
|
|
@@ -16253,17 +16272,8 @@ class SharedWASQLiteConnection {
|
|
|
16253
16272
|
this.activeHoldId = null;
|
|
16254
16273
|
}
|
|
16255
16274
|
}
|
|
16256
|
-
|
|
16257
|
-
return this.
|
|
16258
|
-
}
|
|
16259
|
-
get dbEntry() {
|
|
16260
|
-
return this.options.dbMap.get(this.options.dbFilename);
|
|
16261
|
-
}
|
|
16262
|
-
get connection() {
|
|
16263
|
-
return this.dbEntry.db;
|
|
16264
|
-
}
|
|
16265
|
-
get clientIds() {
|
|
16266
|
-
return this.dbEntry.clientIds;
|
|
16275
|
+
async isAutoCommit() {
|
|
16276
|
+
return this.connection.isAutoCommit();
|
|
16267
16277
|
}
|
|
16268
16278
|
/**
|
|
16269
16279
|
* Handles closing of a shared connection.
|
|
@@ -16325,29 +16335,16 @@ class SharedWASQLiteConnection {
|
|
|
16325
16335
|
"use strict";
|
|
16326
16336
|
__webpack_require__.r(__webpack_exports__);
|
|
16327
16337
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
16328
|
-
/* harmony export */ WorkerWASQLiteConnection: () => (/* binding */ WorkerWASQLiteConnection)
|
|
16329
|
-
/* harmony export */ proxyWASQLiteConnection: () => (/* binding */ proxyWASQLiteConnection)
|
|
16338
|
+
/* harmony export */ WorkerWASQLiteConnection: () => (/* binding */ WorkerWASQLiteConnection)
|
|
16330
16339
|
/* harmony export */ });
|
|
16331
16340
|
/* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! comlink */ "../../node_modules/comlink/dist/esm/comlink.mjs");
|
|
16332
16341
|
/* harmony import */ var _db_adapters_wa_sqlite_WASQLiteConnection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../db/adapters/wa-sqlite/WASQLiteConnection */ "./lib/src/db/adapters/wa-sqlite/WASQLiteConnection.js");
|
|
16333
16342
|
|
|
16334
16343
|
|
|
16335
16344
|
/**
|
|
16336
|
-
*
|
|
16345
|
+
* A Small proxy wrapper around the WASqliteConnection.
|
|
16346
|
+
* This ensures that certain return types are properly proxied.
|
|
16337
16347
|
*/
|
|
16338
|
-
function proxyWASQLiteConnection(connection) {
|
|
16339
|
-
return comlink__WEBPACK_IMPORTED_MODULE_1__.proxy({
|
|
16340
|
-
init: comlink__WEBPACK_IMPORTED_MODULE_1__.proxy(() => connection.init()),
|
|
16341
|
-
close: comlink__WEBPACK_IMPORTED_MODULE_1__.proxy(() => connection.close()),
|
|
16342
|
-
markHold: comlink__WEBPACK_IMPORTED_MODULE_1__.proxy(() => connection.markHold()),
|
|
16343
|
-
releaseHold: comlink__WEBPACK_IMPORTED_MODULE_1__.proxy((holdId) => connection.releaseHold(holdId)),
|
|
16344
|
-
execute: comlink__WEBPACK_IMPORTED_MODULE_1__.proxy((sql, params) => connection.execute(sql, params)),
|
|
16345
|
-
executeRaw: comlink__WEBPACK_IMPORTED_MODULE_1__.proxy((sql, params) => connection.executeRaw(sql, params)),
|
|
16346
|
-
executeBatch: comlink__WEBPACK_IMPORTED_MODULE_1__.proxy((sql, params) => connection.executeBatch(sql, params)),
|
|
16347
|
-
registerOnTableChange: comlink__WEBPACK_IMPORTED_MODULE_1__.proxy((callback) => connection.registerOnTableChange(callback)),
|
|
16348
|
-
getConfig: comlink__WEBPACK_IMPORTED_MODULE_1__.proxy(() => connection.getConfig())
|
|
16349
|
-
});
|
|
16350
|
-
}
|
|
16351
16348
|
class WorkerWASQLiteConnection extends _db_adapters_wa_sqlite_WASQLiteConnection__WEBPACK_IMPORTED_MODULE_0__.WASqliteConnection {
|
|
16352
16349
|
async registerOnTableChange(callback) {
|
|
16353
16350
|
// Proxy the callback remove function
|
|
@@ -16577,7 +16574,7 @@ const openDBShared = async (options) => {
|
|
|
16577
16574
|
clientId,
|
|
16578
16575
|
logger
|
|
16579
16576
|
});
|
|
16580
|
-
return
|
|
16577
|
+
return comlink__WEBPACK_IMPORTED_MODULE_5__.proxy(sharedConnection);
|
|
16581
16578
|
});
|
|
16582
16579
|
};
|
|
16583
16580
|
// Check if we're in a SharedWorker context
|