@powersync/common 0.0.0-dev-20260306125455 → 0.0.0-dev-20260309101613

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.
@@ -9966,21 +9966,11 @@ class TriggerManagerImpl {
9966
9966
  });
9967
9967
  }
9968
9968
  async createDiffDestinationTable(tableName, options) {
9969
- const tableTriggerTypeClause = options?.temporary ? 'TEMP' : '';
9970
- const onlyIfNotExists = options?.onlyIfNotExists ? 'IF NOT EXISTS' : '';
9971
- let x = `
9972
- CREATE ${tableTriggerTypeClause} TABLE ${onlyIfNotExists} ${tableName} (
9973
- operation_id INTEGER PRIMARY KEY AUTOINCREMENT,
9974
- id TEXT,
9975
- operation TEXT,
9976
- timestamp TEXT,
9977
- value TEXT,
9978
- previous_value TEXT
9979
- )
9980
- `;
9981
- console.log(x);
9969
+ const { temporary = true, onlyIfNotExists = false } = options ?? {};
9970
+ const tableTriggerTypeClause = temporary ? 'TEMP' : '';
9971
+ const onlyIfNotExistsClause = onlyIfNotExists ? 'IF NOT EXISTS' : '';
9982
9972
  await this.db.execute(/* sql */ `
9983
- CREATE ${tableTriggerTypeClause} TABLE ${onlyIfNotExists} ${tableName} (
9973
+ CREATE ${tableTriggerTypeClause} TABLE ${onlyIfNotExistsClause} ${tableName} (
9984
9974
  operation_id INTEGER PRIMARY KEY AUTOINCREMENT,
9985
9975
  id TEXT,
9986
9976
  operation TEXT,
@@ -10019,7 +10009,7 @@ class TriggerManagerImpl {
10019
10009
  const internalSource = sourceDefinition.internalName;
10020
10010
  const triggerIds = [];
10021
10011
  const id = await this.getUUID();
10022
- const releaseStorageClaim = useStorage ? await this.options.claimManager.obtainClaim(id) : null;
10012
+ const releaseStorageClaim = useStorage && !manageDestinationExternally ? await this.options.claimManager.obtainClaim(id) : null;
10023
10013
  /**
10024
10014
  * We default to replicating all columns if no columns array is provided.
10025
10015
  */