pqb 0.2.6 → 0.2.7
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.esm.js +3 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/queryMethods/update.test.ts +25 -0
- package/src/sql/update.ts +3 -5
package/dist/index.js
CHANGED
|
@@ -2760,20 +2760,20 @@ const pushUpdateSql = (ctx, model, query, quotedAs) => {
|
|
|
2760
2760
|
ctx.sql.push(`AS ${quotedAs}`);
|
|
2761
2761
|
}
|
|
2762
2762
|
ctx.sql.push("SET");
|
|
2763
|
+
const set = [];
|
|
2763
2764
|
query.data.forEach((item) => {
|
|
2764
2765
|
if (isRaw(item)) {
|
|
2765
|
-
|
|
2766
|
+
set.push(getRaw(item, ctx.values));
|
|
2766
2767
|
} else {
|
|
2767
|
-
const set = [];
|
|
2768
2768
|
for (const key in item) {
|
|
2769
2769
|
const value = item[key];
|
|
2770
2770
|
if (value !== void 0) {
|
|
2771
2771
|
set.push(`${q(key)} = ${processValue(ctx.values, key, value)}`);
|
|
2772
2772
|
}
|
|
2773
2773
|
}
|
|
2774
|
-
ctx.sql.push(set.join(", "));
|
|
2775
2774
|
}
|
|
2776
2775
|
});
|
|
2776
|
+
ctx.sql.push(set.join(", "));
|
|
2777
2777
|
pushWhereStatementSql(ctx, model, query, quotedAs);
|
|
2778
2778
|
pushReturningSql(ctx, model, query, quotedAs);
|
|
2779
2779
|
};
|