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.esm.js
CHANGED
|
@@ -2756,20 +2756,20 @@ const pushUpdateSql = (ctx, model, query, quotedAs) => {
|
|
|
2756
2756
|
ctx.sql.push(`AS ${quotedAs}`);
|
|
2757
2757
|
}
|
|
2758
2758
|
ctx.sql.push("SET");
|
|
2759
|
+
const set = [];
|
|
2759
2760
|
query.data.forEach((item) => {
|
|
2760
2761
|
if (isRaw(item)) {
|
|
2761
|
-
|
|
2762
|
+
set.push(getRaw(item, ctx.values));
|
|
2762
2763
|
} else {
|
|
2763
|
-
const set = [];
|
|
2764
2764
|
for (const key in item) {
|
|
2765
2765
|
const value = item[key];
|
|
2766
2766
|
if (value !== void 0) {
|
|
2767
2767
|
set.push(`${q(key)} = ${processValue(ctx.values, key, value)}`);
|
|
2768
2768
|
}
|
|
2769
2769
|
}
|
|
2770
|
-
ctx.sql.push(set.join(", "));
|
|
2771
2770
|
}
|
|
2772
2771
|
});
|
|
2772
|
+
ctx.sql.push(set.join(", "));
|
|
2773
2773
|
pushWhereStatementSql(ctx, model, query, quotedAs);
|
|
2774
2774
|
pushReturningSql(ctx, model, query, quotedAs);
|
|
2775
2775
|
};
|