@powersync/common 0.0.0-dev-20260202163643 → 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.
package/dist/bundle.cjs CHANGED
@@ -10448,7 +10448,7 @@ function requireDist () {
10448
10448
 
10449
10449
  var distExports = requireDist();
10450
10450
 
10451
- var version = "1.46.0";
10451
+ var version = "1.47.0";
10452
10452
  var PACKAGE = {
10453
10453
  version: version};
10454
10454
 
@@ -13024,7 +13024,11 @@ class AbstractPowerSyncDatabase extends BaseObserver {
13024
13024
  this.logger.warn('Schema validation failed. Unexpected behaviour could occur', ex);
13025
13025
  }
13026
13026
  this._schema = schema;
13027
- await this.database.execute('SELECT powersync_replace_schema(?)', [JSON.stringify(this.schema.toJSON())]);
13027
+ // powersync_replace_schema starts a transaction internally, but we can be more efficient by using BEGIN EXCLUSIVE
13028
+ // on some DB adapters.
13029
+ this.database.writeTransaction((tx) => {
13030
+ return tx.execute('SELECT powersync_replace_schema(?)', [JSON.stringify(this.schema.toJSON())]);
13031
+ });
13028
13032
  await this.database.refreshSchema();
13029
13033
  this.iterateListeners(async (cb) => cb.schemaChanged?.(schema));
13030
13034
  }