@rdyl/node-mysql 0.3.8 → 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/dist/meta.js +2 -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
|
}
|
package/dist/meta.js
CHANGED
|
@@ -101,7 +101,8 @@ var MysqlDbSchema = /** @class */ (function () {
|
|
|
101
101
|
MysqlDbSchema.prototype.$formJson = function (json) {
|
|
102
102
|
var _this = this;
|
|
103
103
|
Object.keys(json).forEach(function (k) {
|
|
104
|
-
if (Object.prototype.hasOwnProperty.call(_this, k)
|
|
104
|
+
if (Object.prototype.hasOwnProperty.call(_this, k) ||
|
|
105
|
+
_this.$mapFields.includes(k)) {
|
|
105
106
|
// @ts-ignore
|
|
106
107
|
_this[k] = json[k];
|
|
107
108
|
}
|