2.1.0b2
Pre-release2.1.0b2
Released: April 16, 2026
orm
-
[orm] [usecase] The
metadata,type_annotation_map, orregistrycan now be
set up in a declarative base also via a mixin class, not only by
directly setting them on the subclass like before.
The declarative class setup now usesgetattr()to look for these
attributes, instead of relying only on the class__dict__.References: #13198
sql
-
[sql] [usecase] Added new parameter
_sql.over.excludeto_sql.over()and
related methods, enabling SQL standard frame exclusion clausesEXCLUDE CURRENT ROW,EXCLUDE GROUP,EXCLUDE TIES,EXCLUDE NO OTHERS
in window functions. Pull request courtesy of Varun Chawla.References: #11671
-
[sql] [usecase] The
ColumnCollectionclass hierarchy has been refactored to allow
column names such asadd,remove,update,extend, and
clearto be used without conflicts.ColumnCollectionis now
an abstract base class, with mutation operations moved to
WriteableColumnCollectionandDedupeColumnCollection
subclasses. TheReadOnlyColumnCollectionexposed as attributes
such asTable.cno longer includes mutation methods that raised
NotImplementedError, allowing these common column names to be
accessed naturally, e.g.table.c.add,table.c.remove,
table.c.update, etc. -
[sql] [bug] A warning is emitted when using the standalone
_sql.distinct()
function in a_sql.select()columns list outside of an aggregate
function; this function is not intended as a replacement for the use of
Select.distinct(). Pull request courtesy bekapono.References: #11526
-
[sql] [bug] Improved the ability for
TypeDecoratorto produce a correct
repr()for "schema" types such asEnumandBoolean.
This is mostly to support the Alembic autogenerate use case so that custom
types render with relevant arguments present. Improved the architecture
used byTypeEngineto producerepr()strings to be more
modular for compound types likeTypeDecorator.References: #13140
schema
-
[schema] [usecase] Most
_sql.FromClausesubclasses are now generic on
_schema.TypedColumnssubclasses, that can be used to type their
_sql.FromClause.ccollection.
This applied to_schema.Table,_sql.Join,
_sql.Subquery,_sql.CTEand more.References: #13085
-
[schema] [bug] Amended the
repr()output forEnumso that the
MetaDatais not shown in the output, as this interferes with
Alembic-autogenerated forms of this type which should be inheriting the
MetaDataof the parent table in the migration script.References: #10604
typing
-
[typing] [bug] Fixed issue in new PEP 646 support for result sets where an issue in the
mypy type checker prevented "scalar" methods including
Connection.scalar(),Result.scalar(),
_orm.Session.scalar(), as well as async versions of these methods
from applying the correct type to the scalar result value, when the columns
in the originating_sql.select()were typed asAny. Pull request
courtesy Yurii Karabas.References: #13091
-
[typing] [bug] Improved typing of
_sqltypes.JSONas well as dialect specific
variants like_postgresql.JSONto include generic capabilities, so
that the types may be parameterized to indicate any specific type of
contents expected, e.g.JSONB[list[str]]().References: #13131
mssql
-
[mssql] [feature] Added support for the
mssql-pythondriver, Microsoft's official Python
driver for SQL Server.References: #12869
oracle
-
[oracle] [feature] Added support for the
_sqltypes.JSONdatatype when using the
Oracle database with the oracledb dialect. JSON values are serialized and
deserialized using configurable strategies that accommodate Oracle's native
JSON type available as of Oracle 21c. Pull request courtesy Abdallah
Alhadad.References: #10375