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 7f065c34
authored
May 15, 2018
by
Paulo R Lopes
Committed by
Sushant
May 15, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(query-generator): add spaces around comparator (#9427)
1 parent
addceb64
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletions
lib/dialects/abstract/query-generator.js
test/unit/dialects/abstract/query-generator.test.js
lib/dialects/abstract/query-generator.js
View file @
7f065c3
...
...
@@ -1918,7 +1918,7 @@ class QueryGenerator {
if
(
value
&&
value
instanceof
Utils
.
SequelizeMethod
)
{
value
=
this
.
getWhereConditions
(
value
,
tableName
,
factory
,
options
,
prepend
);
result
=
value
===
'NULL'
?
key
+
' IS NULL'
:
[
key
,
value
].
join
(
smth
.
comparator
);
result
=
value
===
'NULL'
?
key
+
' IS NULL'
:
[
key
,
value
].
join
(
' '
+
smth
.
comparator
+
' '
);
}
else
if
(
_
.
isPlainObject
(
value
))
{
result
=
this
.
whereItemQuery
(
smth
.
attribute
,
value
,
{
model
:
factory
...
...
test/unit/dialects/abstract/query-generator.test.js
View file @
7f065c3
...
...
@@ -86,6 +86,12 @@ describe('QueryGenerator', () => {
expect
(()
=>
QG
.
whereItemQuery
(
'test'
,
{
$in
:
[
4
]}))
.
to
.
throw
(
'Invalid value { \'$in\': [ 4 ] }'
);
});
it
(
'should correctly parse sequelize.where with .fn as logic'
,
function
()
{
const
QG
=
getAbstractQueryGenerator
(
this
.
sequelize
);
QG
.
handleSequelizeMethod
(
this
.
sequelize
.
where
(
this
.
sequelize
.
col
(
'foo'
),
'LIKE'
,
this
.
sequelize
.
col
(
'bar'
)))
.
should
.
be
.
equal
(
'foo LIKE bar'
);
});
});
});
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