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

Commit 060b9352 by Mathieu Amiot

Adding HAVING clause support to generic query generator

1 parent e1d048e2
Showing with 10 additions and 1 deletions
......@@ -704,6 +704,16 @@ module.exports = (function() {
}
}
// Add HAVING to sub or main query
if (options.hasOwnProperty('having')) {
options.having = this.getWhereConditions(options.having, tableName, factory, options)
if (subQuery) {
subQueryItems.push(" HAVING " + options.having)
} else {
mainQueryItems.push(" HAVING " + options.having)
}
}
// Add ORDER to sub or main query
if (options.order) {
options.order = Array.isArray(options.order) ? options.order.map(function (t) { return this.quote(t) }.bind(this)).join(', ') : options.order
......@@ -715,7 +725,6 @@ module.exports = (function() {
}
}
var limitOrder = this.addLimitAndOffset(options, query)
// Add LIMIT, OFFSET to sub or main query
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!