summaryrefslogtreecommitdiff
path: root/test/sql
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2021-12-04 23:08:05 +0100
committerFederico Caselli <cfederico87@gmail.com>2021-12-04 23:08:05 +0100
commitb2bc0c8e4138ccef4834a415f7be9012e1c6286e (patch)
tree4eff26049e17072bc7b65c92e7d42606720da74c /test/sql
parente88dc004e6bcd1418cb8eb811d0aa580c2a44b8f (diff)
downloadsqlalchemy-b2bc0c8e4138ccef4834a415f7be9012e1c6286e.tar.gz
The where method of exists now accepts multiple cluase.
Support multiple clause elements in the :meth:`_sql.Exists.where` method, unifying the api with the on presented by a normal :func:`_sql.select` construct. Fixes: #7386 Change-Id: I5df20478008cd5167053d357cbfad8a641c62b44
Diffstat (limited to 'test/sql')
-rw-r--r--test/sql/test_compiler.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py
index 6779ea7bf..55c2b07c4 100644
--- a/test/sql/test_compiler.py
+++ b/test/sql/test_compiler.py
@@ -1241,6 +1241,14 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL):
"SELECT NOT (NOT (EXISTS (SELECT 1))) AS anon_1",
)
+ self.assert_compile(
+ exists(42)
+ .select_from(table1)
+ .where(table1.c.name == "foo", table1.c.description == "bar"),
+ "EXISTS (SELECT 42 FROM mytable WHERE mytable.name = :name_1 "
+ "AND mytable.description = :description_1)",
+ )
+
def test_exists_method(self):
subq = (
select(func.count(table2.c.otherid))