summaryrefslogtreecommitdiff
path: root/test/sql/select.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-01-11 21:24:01 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-01-11 21:24:01 +0000
commit6d2d5e923ee32eeea3918d2672f54dff253b253f (patch)
tree8871b7058759a2cf60a88c4e07cc70d806c2f9be /test/sql/select.py
parent664ba4467901df344e915cb50663548c74a703c6 (diff)
downloadsqlalchemy-6d2d5e923ee32eeea3918d2672f54dff253b253f.tar.gz
- added "ilike()" operator to column operations.
compiles to ILIKE on postgres, lower(x) LIKE lower(y) on all others [ticket:727]
Diffstat (limited to 'test/sql/select.py')
-rw-r--r--test/sql/select.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/sql/select.py b/test/sql/select.py
index 70bf704ce..b922c5c22 100644
--- a/test/sql/select.py
+++ b/test/sql/select.py
@@ -451,6 +451,8 @@ sq.myothertable_othername AS sq_myothertable_othername FROM (" + sqstring + ") A
clause = (table1.c.myid == 12) & table1.c.myid.between(15, 20) & table1.c.myid.like('hoho')
assert str(clause) == str(util.pickle.loads(util.pickle.dumps(clause)))
+
+
def testextracomparisonoperators(self):
self.assert_compile(
table1.select(table1.c.name.contains('jo')),
@@ -523,6 +525,11 @@ sq.myothertable_othername AS sq_myothertable_othername FROM (" + sqstring + ") A
"SELECT myothertable.othername, count(myothertable.otherid) AS count_1 FROM myothertable GROUP BY myothertable.othername ORDER BY myothertable.othername"
)
+ def testilike(self):
+ stmt = table1.select(table1.c.name.ilike('%something%'))
+ self.assert_compile(stmt, "SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE lower(mytable.name) LIKE :mytable_name_1")
+ self.assert_compile(stmt, "SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.name ILIKE %(mytable_name_1)s", dialect=postgres.PGDialect())
+
def testforupdate(self):
self.assert_compile(table1.select(table1.c.myid==7, for_update=True), "SELECT mytable.myid, mytable.name, mytable.description FROM mytable WHERE mytable.myid = :mytable_myid_1 FOR UPDATE")