pqb 0.54.2 → 0.54.3

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.mjs CHANGED
@@ -10853,19 +10853,10 @@ const _queryChangeCounter = (self, op, data) => {
10853
10853
  pushQueryValueImmutable(self, "updateData", map);
10854
10854
  return self;
10855
10855
  };
10856
- const update = (self) => {
10857
- const q = self.q;
10858
- q.type = "update";
10859
- if (!q.select) {
10860
- q.returningMany = !q.returnType || q.returnType === "all";
10861
- q.returnType = "valueOrThrow";
10862
- q.returning = true;
10863
- }
10864
- throwIfNoWhere(self, "update");
10865
- return self;
10866
- };
10867
10856
  const _queryUpdate = (query, arg) => {
10868
10857
  const { q } = query;
10858
+ q.type = "update";
10859
+ const returnCount = !q.select;
10869
10860
  const set = { ...arg };
10870
10861
  pushQueryValueImmutable(query, "updateData", set);
10871
10862
  const { shape } = q;
@@ -10932,7 +10923,13 @@ const _queryUpdate = (query, arg) => {
10932
10923
  }
10933
10924
  };
10934
10925
  }
10935
- return update(query);
10926
+ if (returnCount) {
10927
+ q.returningMany = !q.returnType || q.returnType === "all";
10928
+ q.returnType = "valueOrThrow";
10929
+ q.returning = true;
10930
+ }
10931
+ throwIfNoWhere(query, "update");
10932
+ return query;
10936
10933
  };
10937
10934
  const _queryUpdateOrThrow = (q, arg) => {
10938
10935
  q.q.throwOnNotFound = true;