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 b7e07a59
authored
Nov 28, 2013
by
Andreas Lubbe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ne: null now yields "IS NOT NULL" instead of "!= NULL"
1 parent
bdd6251b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
lib/dialects/abstract/query-generator.js
lib/utils.js
lib/dialects/abstract/query-generator.js
View file @
b7e07a5
...
@@ -650,7 +650,7 @@ module.exports = (function() {
...
@@ -650,7 +650,7 @@ module.exports = (function() {
result
.
push
([
_key
,
_value
].
join
(
"="
))
result
.
push
([
_key
,
_value
].
join
(
"="
))
}
else
{
}
else
{
for
(
var
logic
in
value
)
{
for
(
var
logic
in
value
)
{
var
logicResult
=
Utils
.
getWhereLogic
(
logic
)
var
logicResult
=
Utils
.
getWhereLogic
(
logic
,
hash
[
key
][
logic
]);
if
(
logic
===
"IN"
||
logic
===
"NOT IN"
)
{
if
(
logic
===
"IN"
||
logic
===
"NOT IN"
)
{
var
values
=
Array
.
isArray
(
where
[
i
][
ii
])
?
where
[
i
][
ii
]
:
[
where
[
i
][
ii
]]
var
values
=
Array
.
isArray
(
where
[
i
][
ii
])
?
where
[
i
][
ii
]
:
[
where
[
i
][
ii
]]
_where
[
_where
.
length
]
=
i
+
' '
+
logic
+
' ('
+
values
.
map
(
function
(){
return
'?'
}).
join
(
','
)
+
')'
_where
[
_where
.
length
]
=
i
+
' '
+
logic
+
' ('
+
values
.
map
(
function
(){
return
'?'
}).
join
(
','
)
+
')'
...
...
lib/utils.js
View file @
b7e07a5
...
@@ -180,7 +180,7 @@ var Utils = module.exports = {
...
@@ -180,7 +180,7 @@ var Utils = module.exports = {
}
}
else
if
(
type
===
"object"
)
{
else
if
(
type
===
"object"
)
{
Object
.
keys
(
where
[
i
]).
forEach
(
function
(
ii
)
{
Object
.
keys
(
where
[
i
]).
forEach
(
function
(
ii
)
{
logic
=
self
.
getWhereLogic
(
ii
)
logic
=
self
.
getWhereLogic
(
ii
,
where
[
i
][
ii
]);
switch
(
logic
)
{
switch
(
logic
)
{
case
'IN'
:
case
'IN'
:
...
@@ -282,7 +282,7 @@ var Utils = module.exports = {
...
@@ -282,7 +282,7 @@ var Utils = module.exports = {
return
Utils
.
_
.
compactLite
([
text
.
join
(
' AND '
)].
concat
(
whereArgs
))
return
Utils
.
_
.
compactLite
([
text
.
join
(
' AND '
)].
concat
(
whereArgs
))
},
},
getWhereLogic
:
function
(
logic
)
{
getWhereLogic
:
function
(
logic
,
val
)
{
switch
(
logic
)
{
switch
(
logic
)
{
case
'join'
:
case
'join'
:
return
'JOIN'
return
'JOIN'
...
@@ -297,7 +297,8 @@ var Utils = module.exports = {
...
@@ -297,7 +297,8 @@ var Utils = module.exports = {
case
'eq'
:
case
'eq'
:
return
'='
return
'='
case
'ne'
:
case
'ne'
:
return
'!='
if
(
val
)
return
'!='
else
return
'IS NOT'
case
'between'
:
case
'between'
:
case
'..'
:
case
'..'
:
return
'BETWEEN'
return
'BETWEEN'
...
...
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