summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r--lib/sqlalchemy/sql/elements.py3
-rw-r--r--lib/sqlalchemy/sql/operators.py6
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py
index 3caa380ee..3045cb84e 100644
--- a/lib/sqlalchemy/sql/elements.py
+++ b/lib/sqlalchemy/sql/elements.py
@@ -2214,7 +2214,8 @@ class Tuple(ClauseList, ColumnElement):
def __init__(self, *clauses, **kw):
"""Return a :class:`.Tuple`.
- Main usage is to produce a composite IN construct::
+ Main usage is to produce a composite IN construct using
+ :meth:`.ColumnOperators.in_` ::
from sqlalchemy import tuple_
diff --git a/lib/sqlalchemy/sql/operators.py b/lib/sqlalchemy/sql/operators.py
index 4a1a0dcd4..3aeaaa601 100644
--- a/lib/sqlalchemy/sql/operators.py
+++ b/lib/sqlalchemy/sql/operators.py
@@ -528,6 +528,12 @@ class ColumnOperators(Operators):
WHERE COL IN (?, ?, ?)
+ * A list of tuples may be provided if the comparison is against a
+ :func:`.tuple_` containing multiple expressions::
+
+ from sqlalchemy import tuple_
+ stmt.where(tuple_(col1, col2).in_([(1, 10), (2, 20), (3, 30)]))
+
* An empty list, e.g.::
stmt.where(column.in_([]))