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