rel_2_0_40
📦 sqlalchemyView on GitHub →
✨ 3 features🐛 8 fixes🔧 10 symbols
Summary
SQLAlchemy 2.0.40 adds GROUPS frame support for window functions, enhances PostgreSQL foreign‑key ON DELETE actions and ARRAY literals, and includes numerous bug fixes across ORM, SQL compilation, asyncio, and MySQL/SQLite dialects.
✨ New Features
- Added GROUPS frame specification for window functions via `_sql.over.groups` option.
- Added support for specifying a list of columns for `SET NULL` and `SET DEFAULT` actions in PostgreSQL foreign key ON DELETE clause.
- When building a PostgreSQL ARRAY literal with empty clauses, the `type_` parameter is now used to render a cast (e.g., `ARRAY[]::INTEGER`).
🐛 Bug Fixes
- Fixed regression where an inappropriate type in a `Mapped` annotation raised `TypeError` instead of `ArgumentError`; introduced `MappedAnnotationError` subclass.
- Fixed regression in ORM annotated declarative class interpretation caused by `typing_extension==4.13.0` TypeAliasType incompatibility.
- Fixed CTE compilation error where multiple INSERT statements with multiple VALUES parameter sets generated conflicting bound parameter names.
- Fixed SQL compilation issue with double aliasing of same‑named FROM clauses, preventing invalid SQL with duplicate AS clauses.
- Fixed `AsyncSession.get_transaction()` and `AsyncSession.get_nested_transaction()` raising `NotImplementedError` after proxy transaction garbage collection.
- Re‑added support for MySQL‑Connector/Python DBAPI using `mysql+mysqlconnector://` URL scheme (server‑side cursor disabled).
- Fixed MySQL server default reflection for defaults containing spaces and improved parenthesis handling for such defaults.
- Expanded SQLite server default parenthesis rules to handle defaults with non‑word characters.
🔧 Affected Symbols
MappedAnnotationErrorAsyncSession.get_transactionAsyncSession.get_nested_transactionsqlalchemy.sql.overFunctionElement.over_postgresql.arrayCTEFromClauseMySQLDialectSQLiteDialect