diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2021-12-05 19:24:12 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-12-05 19:24:12 +0000 |
commit | 8994fbbd682a20fe75bd1645f69329fbb4f5981b (patch) | |
tree | 6ecca42b2a4d655403eb2b1c0d8b3fe9652be8d3 /lib/sqlalchemy/sql/selectable.py | |
parent | 995fb577a64061a9cbab62b481c65a4c4d3e5a67 (diff) | |
parent | b2bc0c8e4138ccef4834a415f7be9012e1c6286e (diff) | |
download | sqlalchemy-8994fbbd682a20fe75bd1645f69329fbb4f5981b.tar.gz |
Merge "The where method of exists now accepts multiple cluase." into main
Diffstat (limited to 'lib/sqlalchemy/sql/selectable.py')
-rw-r--r-- | lib/sqlalchemy/sql/selectable.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index a82a76e53..ca3ccc6bc 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -6490,6 +6490,9 @@ class Exists(UnaryExpression): See :func:`_sql.exists` for a description of usage. + An ``EXISTS`` clase can also be construed from a :func:`_sql.select` + instance by calling :meth:`_sql.SelectBase.exists`. + """ _from_objects = [] @@ -6528,6 +6531,9 @@ class Exists(UnaryExpression): :ref:`tutorial_exists` - in the :term:`2.0 style` tutorial. + :meth:`_sql.SelectBase.exists` - method to transform a ``SELECT`` to an + ``EXISTS`` clause. + """ # noqa E501 if args and isinstance(args[0], (SelectBase, ScalarSelect)): s = args[0] @@ -6642,7 +6648,7 @@ class Exists(UnaryExpression): e.element = self._regroup(lambda element: element.select_from(*froms)) return e - def where(self, clause): + def where(self, *clause): """Return a new :func:`_expression.exists` construct with the given expression added to its WHERE clause, joined to the existing clause via AND, if any. @@ -6655,7 +6661,7 @@ class Exists(UnaryExpression): """ e = self._clone() - e.element = self._regroup(lambda element: element.where(clause)) + e.element = self._regroup(lambda element: element.where(*clause)) return e |