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 06eb90ae
authored
May 04, 2015
by
Jan Aagaard Meier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3364 from 3ch01c/likeany
Add support for WHERE LIKE ANY queries
2 parents
ca49a7cd
db1733c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
1 deletions
lib/dialects/abstract/query-generator.js
test/unit/sql/where.test.js
lib/dialects/abstract/query-generator.js
View file @
06eb90a
...
...
@@ -1910,6 +1910,10 @@ module.exports = (function() {
if
(
comparatorMap
[
key
])
{
comparator
=
comparatorMap
[
key
];
value
=
item
;
if
(
_
.
isPlainObject
(
value
)
&&
value
.
$any
){
comparator
+=
' ANY'
;
value
=
value
.
$any
;
}
}
});
}
...
...
@@ -2171,4 +2175,3 @@ module.exports = (function() {
return
QueryGenerator
;
})();
test/unit/sql/where.test.js
View file @
06eb90a
...
...
@@ -452,6 +452,37 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
});
});
});
suite
(
'$like'
,
function
()
{
testsql
(
'userId'
,
{
$like
:
{
$any
:
[
'foo'
,
'bar'
,
'baz'
]
}
},
{
postgres
:
"\"userId\" LIKE ANY ARRAY['foo','bar','baz']"
});
testsql
(
'userId'
,
{
$iLike
:
{
$any
:
[
'foo'
,
'bar'
,
'baz'
]
}
},
{
postgres
:
"\"userId\" ILIKE ANY ARRAY['foo','bar','baz']"
});
testsql
(
'userId'
,
{
$notLike
:
{
$any
:
[
'foo'
,
'bar'
,
'baz'
]
}
},
{
postgres
:
"\"userId\" NOT LIKE ANY ARRAY['foo','bar','baz']"
});
testsql
(
'userId'
,
{
$notILike
:
{
$any
:
[
'foo'
,
'bar'
,
'baz'
]
}
},
{
postgres
:
"\"userId\" NOT ILIKE ANY ARRAY['foo','bar','baz']"
});
});
});
}
...
...
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