pqb 0.47.0 → 0.47.1

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
@@ -2154,7 +2154,7 @@ const makeRowToJson = (table, shape, aliasName) => {
2154
2154
  `'${key}', "${table}"."${aliasName && column.data.name || key}"${column.data.jsonCast ? `::${column.data.jsonCast}` : ""}`
2155
2155
  );
2156
2156
  }
2157
- return isSimple ? `row_to_json("${table}".*)` : "json_build_object(" + list.join(", ") + ")";
2157
+ return isSimple ? `row_to_json("${table}".*)` : `CASE WHEN "${table}".* IS NULL THEN NULL ELSE json_build_object(` + list.join(", ") + ") END";
2158
2158
  };
2159
2159
 
2160
2160
  const queryTypeWithLimitOne = {