pqb 0.46.3 → 0.47.0
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 +11 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4453,7 +4453,7 @@ class RowToJsonExpression extends orchidCore.Expression {
|
|
|
4453
4453
|
let rowToJson;
|
|
4454
4454
|
if (Object.values(jsonList).some((x) => x?.data.jsonCast)) {
|
|
4455
4455
|
rowToJson = `json_build_object(${Object.entries(jsonList).map(
|
|
4456
|
-
([key, column]) => `'${key}', t
|
|
4456
|
+
([key, column]) => `'${key}', t."${key}"${column?.data.jsonCast ? `::${column.data.jsonCast}` : ""}`
|
|
4457
4457
|
).join(", ")})`;
|
|
4458
4458
|
} else {
|
|
4459
4459
|
rowToJson = "row_to_json(t.*)";
|
|
@@ -5987,14 +5987,21 @@ const subJoinToSql = (ctx, jq, innerAs, outerAs, cloned) => {
|
|
|
5987
5987
|
)}) ${outerAs || innerAs}`;
|
|
5988
5988
|
};
|
|
5989
5989
|
const processArgs = (args, ctx, query, joinAs, joinShape, quotedAs) => {
|
|
5990
|
-
return args.length === 1 ? getObjectOrRawConditions(
|
|
5990
|
+
return args.length ? args.length === 1 ? getObjectOrRawConditions(
|
|
5991
|
+
ctx,
|
|
5992
|
+
query,
|
|
5993
|
+
args[0],
|
|
5994
|
+
quotedAs,
|
|
5995
|
+
joinAs,
|
|
5996
|
+
joinShape
|
|
5997
|
+
) : getConditionsFor3Or4LengthItem(
|
|
5991
5998
|
ctx,
|
|
5992
5999
|
query,
|
|
5993
6000
|
joinAs,
|
|
5994
6001
|
quotedAs,
|
|
5995
6002
|
args,
|
|
5996
6003
|
joinShape
|
|
5997
|
-
);
|
|
6004
|
+
) : void 0;
|
|
5998
6005
|
};
|
|
5999
6006
|
const getConditionsFor3Or4LengthItem = (ctx, query, target, quotedAs, args, joinShape) => {
|
|
6000
6007
|
const [leftColumn, opOrRightColumn, maybeRightColumn] = args;
|
|
@@ -8297,7 +8304,7 @@ const handleOneData = (q, data, ctx) => {
|
|
|
8297
8304
|
columns.map(
|
|
8298
8305
|
(key) => (
|
|
8299
8306
|
// undefined values were stripped and no need to check for them
|
|
8300
|
-
encoders[key] && !orchidCore.isExpression(data[key]) ? encoders[key](data[key]) : data[key]
|
|
8307
|
+
encoders[key] && !orchidCore.isExpression(data[key]) && data[key] !== null ? encoders[key](data[key]) : data[key]
|
|
8301
8308
|
)
|
|
8302
8309
|
)
|
|
8303
8310
|
];
|