@powersync/web 1.23.0 → 1.23.2

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 CHANGED
@@ -38839,7 +38839,7 @@ class LockedAsyncDatabaseAdapter extends _powersync_common__WEBPACK_IMPORTED_MOD
38839
38839
  return this.readLock(this.wrapTransaction(fn));
38840
38840
  }
38841
38841
  writeTransaction(fn, options) {
38842
- return this.writeLock(this.wrapTransaction(fn));
38842
+ return this.writeLock(this.wrapTransaction(fn, true));
38843
38843
  }
38844
38844
  generateDBHelpers(tx) {
38845
38845
  return {
@@ -38874,9 +38874,9 @@ class LockedAsyncDatabaseAdapter extends _powersync_common__WEBPACK_IMPORTED_MOD
38874
38874
  /**
38875
38875
  * Wraps a lock context into a transaction context
38876
38876
  */
38877
- wrapTransaction(cb) {
38877
+ wrapTransaction(cb, write = false) {
38878
38878
  return async (tx) => {
38879
- await this._execute('BEGIN TRANSACTION');
38879
+ await this._execute(write ? 'BEGIN EXCLUSIVE' : 'BEGIN');
38880
38880
  let finalized = false;
38881
38881
  const commit = async () => {
38882
38882
  if (finalized) {