pqb 0.43.4 → 0.43.5

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/index.js CHANGED
@@ -3709,6 +3709,7 @@ class ArrayColumn extends ColumnType {
3709
3709
  }
3710
3710
  }
3711
3711
  const parse = function(source) {
3712
+ if (typeof source !== "string") return source;
3712
3713
  const entries = [];
3713
3714
  parsePostgresArray(source, entries, this.data.item.data.parseItem);
3714
3715
  return entries;
@@ -6658,7 +6659,14 @@ const pushCopySql = (ctx, table, query, quotedAs) => {
6658
6659
 
6659
6660
  const toSQLCacheKey = Symbol("toSQLCache");
6660
6661
  const toSQL = (table, options) => {
6661
- return !options?.clearCache && table.q[toSQLCacheKey] || (table.q[toSQLCacheKey] = makeSQL(table, options));
6662
+ if (table.q[toSQLCacheKey] && !options?.clearCache) {
6663
+ const cached = table.q[toSQLCacheKey];
6664
+ if (options?.values && "values" in cached && cached.values && options.values !== cached.values) {
6665
+ options.values.push(...cached.values);
6666
+ }
6667
+ return cached;
6668
+ }
6669
+ return table.q[toSQLCacheKey] = makeSQL(table, options);
6662
6670
  };
6663
6671
  const makeSQL = (table, options) => {
6664
6672
  const query = table.q;