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