:tags: typing
:tickets: 10646
- The default implementation of :attr:`_sql.TypeEngine.python_type` now
+ The default implementation of :attr:`_types.TypeEngine.python_type` now
returns ``object`` instead of ``NotImplementedError``, since that's the
base for all types in Python3.
- The ``python_type`` of :class:`_sql.JSON` no longer returns ``dict``,
+ The ``python_type`` of :class:`_types.JSON` no longer returns ``dict``,
but instead fallbacks to the generic implementation.
.. change::
Added support for per-session execution options that are merged into all
queries executed within that session. The :class:`_orm.Session`,
:class:`_orm.sessionmaker`, :class:`_orm.scoped_session`,
- :class:`_ext.asyncio.AsyncSession`, and
- :class:`_ext.asyncio.async_sessionmaker` constructors now accept an
+ :class:`_asyncio.AsyncSession`, and
+ :class:`_asyncio.async_sessionmaker` constructors now accept an
:paramref:`_orm.Session.execution_options` parameter that will be applied
to all explicit query executions (e.g. using :meth:`_orm.Session.execute`,
:meth:`_orm.Session.get`, :meth:`_orm.Session.scalars`) for that session
:tags: usecase, sql, orm
:tickets: 8601
- The :meth:`_sql.Select.filter_by`, :meth:`_sql.Update.filter_by` and
- :meth:`_sql.Delete.filter_by` methods now search across all entities
+ The :meth:`_sql.Select.filter_by`, :meth:`.Update.filter_by` and
+ :meth:`.Delete.filter_by` methods now search across all entities
present in the statement, rather than limiting their search to only the
last joined entity or the first FROM entity. This allows these methods
to locate attributes unambiguously across multiple joined tables,
.. automethod:: Delete.where
+ .. automethod:: Delete.filter
+
+ .. automethod:: Delete.filter_by
+
.. automethod:: Delete.with_dialect_options
.. automethod:: Delete.returning
.. automethod:: Update.where
+ .. automethod:: Update.filter
+
+ .. automethod:: Update.filter_by
+
.. automethod:: Update.with_dialect_options
.. automethod:: Update.values
return self
def filter(self, *criteria: roles.ExpressionElementRole[Any]) -> Self:
- """A synonym for the :meth:`_dml.DMLWhereBase.where` method.
+ """A synonym for the :meth:`.where` method.
.. versionadded:: 1.4
.. seealso::
- :meth:`.DMLWhereBase.where` - filter on SQL expressions.
+ :meth:`.where` - filter on SQL expressions.
:meth:`_sql.Select.filter_by`
self._columns.add(c, index=index)
c.table = self
- def append_column(self, c: ColumnClause[Any]) -> None:
- self._insert_col_impl(c)
+ def append_column(self, column: ColumnClause[Any]) -> None:
+ """Append a :class:`.ColumnClause` to this :class:`.TableClause`."""
+ self._insert_col_impl(column)
- def insert_column(self, c: ColumnClause[Any], index: int) -> None:
- self._insert_col_impl(c, index=index)
+ def insert_column(self, column: ColumnClause[Any], index: int) -> None:
+ """Insert a :class:`.ColumnClause` to this :class:`.TableClause` at
+ a specific position.
+
+ .. versionadded:: 2.1
+
+ """
+ self._insert_col_impl(column, index=index)
@util.preload_module("sqlalchemy.sql.dml")
def insert(self) -> util.preloaded.sql_dml.Insert: