@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.
package/dist/bundle.cjs CHANGED
@@ -12490,21 +12490,11 @@ class TriggerManagerImpl {
12490
12490
  });
12491
12491
  }
12492
12492
  async createDiffDestinationTable(tableName, options) {
12493
- const tableTriggerTypeClause = options?.temporary ? 'TEMP' : '';
12494
- const onlyIfNotExists = options?.onlyIfNotExists ? 'IF NOT EXISTS' : '';
12495
- let x = `
12496
- CREATE ${tableTriggerTypeClause} TABLE ${onlyIfNotExists} ${tableName} (
12497
- operation_id INTEGER PRIMARY KEY AUTOINCREMENT,
12498
- id TEXT,
12499
- operation TEXT,
12500
- timestamp TEXT,
12501
- value TEXT,
12502
- previous_value TEXT
12503
- )
12504
- `;
12505
- console.log(x);
12493
+ const { temporary = true, onlyIfNotExists = false } = options ?? {};
12494
+ const tableTriggerTypeClause = temporary ? 'TEMP' : '';
12495
+ const onlyIfNotExistsClause = onlyIfNotExists ? 'IF NOT EXISTS' : '';
12506
12496
  await this.db.execute(/* sql */ `
12507
- CREATE ${tableTriggerTypeClause} TABLE ${onlyIfNotExists} ${tableName} (
12497
+ CREATE ${tableTriggerTypeClause} TABLE ${onlyIfNotExistsClause} ${tableName} (
12508
12498
  operation_id INTEGER PRIMARY KEY AUTOINCREMENT,
12509
12499
  id TEXT,
12510
12500
  operation TEXT,
@@ -12543,7 +12533,7 @@ class TriggerManagerImpl {
12543
12533
  const internalSource = sourceDefinition.internalName;
12544
12534
  const triggerIds = [];
12545
12535
  const id = await this.getUUID();
12546
- const releaseStorageClaim = useStorage ? await this.options.claimManager.obtainClaim(id) : null;
12536
+ const releaseStorageClaim = useStorage && !manageDestinationExternally ? await this.options.claimManager.obtainClaim(id) : null;
12547
12537
  /**
12548
12538
  * We default to replicating all columns if no columns array is provided.
12549
12539
  */