不要怂,就是干,撸起袖子干!

Stringify JSON objects when escaped

1 parent 6df22f64
Showing with 2 additions and 0 deletions
...@@ -799,6 +799,8 @@ module.exports = (function() { ...@@ -799,6 +799,8 @@ module.exports = (function() {
if (Utils._.isObject(value) && field && (field.type === DataTypes.HSTORE || field.type === DataTypes.ARRAY(DataTypes.HSTORE))) { if (Utils._.isObject(value) && field && (field.type === DataTypes.HSTORE || field.type === DataTypes.ARRAY(DataTypes.HSTORE))) {
value = hstore.stringify(value); value = hstore.stringify(value);
} else if (Utils._.isObject(value) && field && (field.type === DataTypes.JSON)) {
value = JSON.stringify(value);
} }
return SqlString.escape(value, false, this.options.timezone, this.dialect, field); return SqlString.escape(value, false, this.options.timezone, this.dialect, field);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!