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