Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit 060b9352
authored
Jan 24, 2014
by
Mathieu Amiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding HAVING clause support to generic query generator
1 parent
e1d048e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
lib/dialects/abstract/query-generator.js
lib/dialects/abstract/query-generator.js
View file @
060b935
...
@@ -703,6 +703,16 @@ module.exports = (function() {
...
@@ -703,6 +703,16 @@ module.exports = (function() {
mainQueryItems
.
push
(
" GROUP BY "
+
options
.
group
)
mainQueryItems
.
push
(
" GROUP BY "
+
options
.
group
)
}
}
}
}
// 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
// Add ORDER to sub or main query
if
(
options
.
order
)
{
if
(
options
.
order
)
{
...
@@ -715,7 +725,6 @@ module.exports = (function() {
...
@@ -715,7 +725,6 @@ module.exports = (function() {
}
}
}
}
var
limitOrder
=
this
.
addLimitAndOffset
(
options
,
query
)
var
limitOrder
=
this
.
addLimitAndOffset
(
options
,
query
)
// Add LIMIT, OFFSET to sub or main query
// Add LIMIT, OFFSET to sub or main query
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment