rel_2_0_45
📦 sqlalchemyView on GitHub →
✨ 2 features🐛 11 fixes🔧 11 symbols
Summary
SQLAlchemy 2.0.45 introduces PostgreSQL collation reflection and MySQL FOR SHARE support, while fixing numerous bugs across ORM, SQL, typing, and SQLite reflection.
✨ New Features
- Added support for reflection of collation in PostgreSQL type objects; the collation is set only when it differs from the default.
- Added MySQL 8.0.1+ support for FOR SHARE clause in Select.with_for_update(), enabling NOWAIT and SKIP LOCKED compatibility.
🐛 Bug Fixes
- Fixed AttributeError when calling Mapper.add_property() inside early mapper event hooks by initializing internal property collections earlier.
- Fixed dataclass transformation failure on Python 3.14 when a MappedAsDataclass class referenced a relationship to a class defined only in a TYPE_CHECKING block, handling PEP 649 deferred annotations.
- Corrected short_selects example cache usage to allow proper performance comparison.
- Improved ClauseElement.params() handling of bound parameters; full fix deferred to 2.1.
- Fixed NotImplementedError when using ColumnOperators.in_() with a nested CompoundSelect as the first argument by updating _scalar_type() handling.
- Fixed typing for Select.with_for_update().of to accept lists of ORM entities and other FROM clauses.
- Fixed typing for coalesce() to return correct type when nullable arguments are provided.
- Fixed rendering order of PostgreSQL dialect options (postgresql_include) on PrimaryKeyConstraint and UniqueConstraint when combined with deferrable options.
- Fixed engine_insertmanyvalues SQL generation for explicit sequences with nextval() to ensure correct invocation order.
- Improved SQLite reflection of CHECK constraints to correctly handle table names containing 'CHECK' or 'CONSTRAINT', all quoting styles, and parentheses within string literals.
- Fixed SQLite reflection of constraint names with uppercase letters or characters requiring quoting by updating regex parsing.
🔧 Affected Symbols
Mapper.add_propertyMappedAsDataclassColumnOperators.in__sql.ClauseElement.params_scalar_typeSelect.with_for_updatecoalescePrimaryKeyConstraint.postgresql_includeUniqueConstraint.postgresql_includeengine_insertmanyvaluessqlite.dialect