Return a :class:`.Tuple`. Main usage is to produce a composite IN construct using :meth:`.ColumnOperators.in_` :: from sqlalchemy import tuple_ tuple_(table.c.col1, table.c.col2).in_([(1, 2), (5, 12), (10, 19)]) .. warning:: The composite IN construct is not
(
*clauses: _ColumnExpressionOrLiteralArgument[Any],
types: Optional[Sequence[_TypeEngineArgument[Any]]] = None,
)
| 1958 | |
| 1959 | |
| 1960 | def tuple_( |
| 1961 | *clauses: _ColumnExpressionOrLiteralArgument[Any], |
| 1962 | types: Optional[Sequence[_TypeEngineArgument[Any]]] = None, |
| 1963 | ) -> Tuple: |
| 1964 | """Return a :class:`.Tuple`. |
| 1965 | |
| 1966 | Main usage is to produce a composite IN construct using |
| 1967 | :meth:`.ColumnOperators.in_` :: |
| 1968 | |
| 1969 | from sqlalchemy import tuple_ |
| 1970 | |
| 1971 | tuple_(table.c.col1, table.c.col2).in_([(1, 2), (5, 12), (10, 19)]) |
| 1972 | |
| 1973 | .. warning:: |
| 1974 | |
| 1975 | The composite IN construct is not supported by all backends, and is |
| 1976 | currently known to work on PostgreSQL, MySQL, and SQLite. |
| 1977 | Unsupported backends will raise a subclass of |
| 1978 | :class:`~sqlalchemy.exc.DBAPIError` when such an expression is |
| 1979 | invoked. |
| 1980 | |
| 1981 | """ |
| 1982 | return Tuple(*clauses, types=types) |
| 1983 | |
| 1984 | |
| 1985 | def type_coerce( |