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