@powersync/common 0.0.0-dev-20260216124709 → 0.0.0-dev-20260226160529

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.
@@ -7926,7 +7926,7 @@ function requireDist () {
7926
7926
 
7927
7927
  var distExports = requireDist();
7928
7928
 
7929
- var version = "1.46.0";
7929
+ var version = "1.47.0";
7930
7930
  var PACKAGE = {
7931
7931
  version: version};
7932
7932
 
@@ -10502,7 +10502,11 @@ class AbstractPowerSyncDatabase extends BaseObserver {
10502
10502
  this.logger.warn('Schema validation failed. Unexpected behaviour could occur', ex);
10503
10503
  }
10504
10504
  this._schema = schema;
10505
- await this.database.execute('SELECT powersync_replace_schema(?)', [JSON.stringify(this.schema.toJSON())]);
10505
+ // powersync_replace_schema starts a transaction internally, but we can be more efficient by using BEGIN EXCLUSIVE
10506
+ // on some DB adapters.
10507
+ this.database.writeTransaction((tx) => {
10508
+ return tx.execute('SELECT powersync_replace_schema(?)', [JSON.stringify(this.schema.toJSON())]);
10509
+ });
10506
10510
  await this.database.refreshSchema();
10507
10511
  this.iterateListeners(async (cb) => cb.schemaChanged?.(schema));
10508
10512
  }