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

Commit ee73ed55 by Mick Hansen

feat: rlike support for mysql

1 parent 07be397d
Showing with 20 additions and 0 deletions
...@@ -313,6 +313,8 @@ var Utils = module.exports = { ...@@ -313,6 +313,8 @@ var Utils = module.exports = {
return 'NOT IN' return 'NOT IN'
case 'like': case 'like':
return 'LIKE' return 'LIKE'
case 'rlike':
return 'RLIKE'
case 'nlike': case 'nlike':
case 'notlike': case 'notlike':
return 'NOT LIKE' return 'NOT LIKE'
......
...@@ -125,6 +125,24 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -125,6 +125,24 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
}) })
}) })
if (dialect === 'mysql') {
it('should be able to find a row using rlike', function(done) {
this.User.findAll({
where: {
username: {
rlike: 'o2$'
}
}
}).success(function(users) {
expect(users).to.be.an.instanceof(Array)
expect(users).to.have.length(1)
expect(users[0].username).to.equal('boo2')
expect(users[0].intVal).to.equal(10)
done()
})
})
}
it('should be able to find a row using not like', function(done) { it('should be able to find a row using not like', function(done) {
this.User.findAll({ this.User.findAll({
where: { where: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!