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