Skip to content

Commit 292cf9b

Browse files
committed
Merge pull request brianc#182 from eagleshine/master
Adding two operator for mysql: regexp for 'REGEXP' and rlike for 'RLIKE'.
2 parents c5f0d16 + 8ecf9a6 commit 292cf9b

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

lib/node/valueExpression.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,15 @@ var ValueExpressionMixin = function() {
138138
bitwiseOr : binaryMethod('|'),
139139
bitwiseXor : binaryMethod('#'),
140140
regex : binaryMethod('~'),
141+
regexp : binaryMethod('REGEXP'),
141142
notRegex : binaryMethod('!~'),
142143
concat : binaryMethod('||'),
143144
key : binaryMethod('->'),
144145
keyText : binaryMethod('->>'),
145146
path : binaryMethod('#>'),
146147
pathText : binaryMethod('#>>'),
147148
like : binaryMethod('LIKE'),
149+
rlike : binaryMethod('RLIKE'),
148150
notLike : binaryMethod('NOT LIKE'),
149151
in : inMethod,
150152
notIn : notInMethod,

test/binary-clause-tests.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ test('operators', function() {
3434
assert.equal(Foo.baz.modulo(1).operator, '%');
3535
assert.equal(Foo.baz.regex(1).operator, '~');
3636
assert.equal(Foo.baz.notRegex(1).operator, '!~');
37+
assert.equal(Foo.baz.regexp(1).operator, 'REGEXP');
38+
assert.equal(Foo.baz.rlike(1).operator, 'RLIKE');
3739
});

0 commit comments

Comments
 (0)