@rdyl/node-mysql 0.3.2 → 0.3.3
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/CHANGELOG.md +1 -1
- package/dist/helper.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/helper.js
CHANGED
|
@@ -104,7 +104,7 @@ var BaseHelper = /** @class */ (function () {
|
|
|
104
104
|
sqlList.push("COALESCE(\n (\n SELECT JSON_ARRAYAGG(\n JSON_OBJECT(".concat(fieldsSql, ")\n )\n FROM ").concat(item.relatedTable, "\n JOIN ").concat(item.table, " ON ").concat(item.table, ".id = ").concat(item.relatedTable, ".").concat(item.table, "_id\n WHERE ").concat(item.relatedTable, ".").concat(_this.table, "_id = ").concat(_this.table, ".id\n ),\n JSON_ARRAY()\n) AS ").concat(item.table));
|
|
105
105
|
}
|
|
106
106
|
else {
|
|
107
|
-
sqlList.push("COALESCE(\n (\n SELECT JSON_OBJECT(".concat(fieldsSql, ")\n FROM ").concat(item.relatedTable, "\n JOIN ").concat(item.table, " ON ").concat(item.table, ".id = ").concat(item.relatedTable, ".").concat(item.table, "_id\n WHERE ").concat(item.relatedTable, ".").concat(_this.table, "_id = ").concat(_this.table, ".id\n LIMIT 1\n ),\n JSON_OBJECT()\n) AS
|
|
107
|
+
sqlList.push("COALESCE(\n (\n SELECT JSON_OBJECT(".concat(fieldsSql, ")\n FROM ").concat(item.relatedTable, "\n JOIN ").concat(item.table, " ON ").concat(item.table, ".id = ").concat(item.relatedTable, ".").concat(item.table, "_id\n WHERE ").concat(item.relatedTable, ".").concat(_this.table, "_id = ").concat(_this.table, ".id\n LIMIT 1\n ),\n JSON_OBJECT()\n) AS ").concat(item.table, ",\n"));
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
}
|