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

Commit 9203b73f by Jan Aagaard Meier

Merge pull request #5280 from renatoelias/fix-hstore-without-model

fix usign hstore without model instance
2 parents 52322ba3 dbefc9e5
Showing with 8 additions and 0 deletions
......@@ -313,11 +313,19 @@ module.exports = function (BaseTypes) {
});
HSTORE.parse = function (value) {
if (!hstore) {
// All datatype files are loaded at import - make sure we don't load the hstore parser before a hstore is instantiated
hstore = require('./hstore');
}
return hstore.parse(value);
};
HSTORE.prototype.escape = false;
HSTORE.prototype.$stringify = function (value) {
if (!hstore) {
// All datatype files are loaded at import - make sure we don't load the hstore parser before a hstore is instantiated
hstore = require('./hstore');
}
return "'" + hstore.stringify(value) + "'";
};
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!