@powersync/web 1.35.0 → 1.36.0
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/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-89f0ba.index.umd.js +9 -6
- package/dist/_journeyapps_wa-sqlite-_journeyapps_wa-sqlite_src_examples_AccessHandlePoolVFS_js-_journeyapp-89f0ba.index.umd.js.map +1 -1
- package/dist/index.umd.js +9 -6
- package/dist/index.umd.js.map +1 -1
- package/dist/worker/SharedSyncImplementation.umd.js +157 -14
- package/dist/worker/SharedSyncImplementation.umd.js.map +1 -1
- package/dist/worker/WASQLiteDB.umd.js +148 -8
- package/dist/worker/WASQLiteDB.umd.js.map +1 -1
- package/lib/package.json +2 -2
- package/lib/src/db/adapters/LockedAsyncDatabaseAdapter.js +9 -6
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/db/adapters/LockedAsyncDatabaseAdapter.ts +14 -15
package/lib/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powersync/web",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.36.0",
|
|
4
4
|
"description": "PowerSync Web SDK",
|
|
5
5
|
"main": "lib/src/index.js",
|
|
6
6
|
"module": "lib/src/index.js",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"license": "Apache-2.0",
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@journeyapps/wa-sqlite": "catalog:",
|
|
70
|
-
"@powersync/common": "workspace:^1.
|
|
70
|
+
"@powersync/common": "workspace:^1.49.0"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@powersync/common": "workspace:*",
|
|
@@ -50,7 +50,8 @@ export class LockedAsyncDatabaseAdapter extends BaseObserver {
|
|
|
50
50
|
}
|
|
51
51
|
this.dbGetHelpers = this.generateDBHelpers({
|
|
52
52
|
execute: (query, params) => this.acquireLock(() => this._execute(query, params)),
|
|
53
|
-
executeRaw: (query, params) => this.acquireLock(() => this._executeRaw(query, params))
|
|
53
|
+
executeRaw: (query, params) => this.acquireLock(() => this._executeRaw(query, params)),
|
|
54
|
+
executeBatch: (query, params) => this.acquireLock(() => this._executeBatch(query, params))
|
|
54
55
|
});
|
|
55
56
|
this.initPromise = this._init();
|
|
56
57
|
}
|
|
@@ -211,14 +212,16 @@ export class LockedAsyncDatabaseAdapter extends BaseObserver {
|
|
|
211
212
|
return this.dbGetHelpers.get(sql, parameters);
|
|
212
213
|
}
|
|
213
214
|
async readLock(fn, options) {
|
|
214
|
-
|
|
215
|
-
return this.
|
|
216
|
-
timeoutMs: options?.timeoutMs ?? this.options.defaultLockTimeoutMs
|
|
217
|
-
});
|
|
215
|
+
// Read and write locks are the same because we only have one underlying connection.
|
|
216
|
+
return this.writeLock(fn, options);
|
|
218
217
|
}
|
|
219
218
|
async writeLock(fn, options) {
|
|
220
219
|
await this.waitForInitialized();
|
|
221
|
-
return this.acquireLock(async () => fn(this.generateDBHelpers({
|
|
220
|
+
return this.acquireLock(async () => fn(this.generateDBHelpers({
|
|
221
|
+
execute: this._execute,
|
|
222
|
+
executeRaw: this._executeRaw,
|
|
223
|
+
executeBatch: this._executeBatch
|
|
224
|
+
})), {
|
|
222
225
|
timeoutMs: options?.timeoutMs ?? this.options.defaultLockTimeoutMs
|
|
223
226
|
});
|
|
224
227
|
}
|