pqb 0.47.0 → 0.47.2

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