rel_2_0_46
📦 sqlalchemyView on GitHub →
✨ 2 features🐛 6 fixes🔧 6 symbols
Summary
This release focuses heavily on bug fixes across multiple dialects, including improved type checking support for ORM entities, correct SQL generation for PostgreSQL JSONB operations, and compatibility fixes for MariaDB sequences and the aiosqlite driver.
✨ New Features
- Added support for the `IF EXISTS` clause when dropping indexes on SQL Server 2016 (13.x) and later versions via `DropIndex.if_exists`.
- Implemented support for "terminate" with aiosqlite when using version 0.22.1 or greater, which implements a sync `.stop()` method.
🐛 Bug Fixes
- Fixed typing issues where ORM mapped classes and aliased entities could not be used as keys in result row mappings or as join targets in select statements by updating type definitions for `_KeyType` and `_FromClauseArgument`.
- Fixed issue where PostgreSQL JSONB operators `_postgresql.JSONB.Comparator.path_match()` and `_postgresql.JSONB.Comparator.path_exists()` were applying incorrect `VARCHAR` casts to the right-hand side operand when used with newer PostgreSQL drivers, now indicating the right-hand type as `JSONPATH`.
- Fixed regression in PostgreSQL dialect where JSONB subscription syntax would generate incorrect SQL for `cast()` expressions returning JSONB, ensuring cast expressions are properly wrapped in parentheses when using `[]` subscription syntax.
- Improved the foreign key reflection regular expression pattern in the PostgreSQL dialect to be more permissive, correctly handling unicode characters in table and column names, improving compatibility with CockroachDB.
- Fixed the SQL compilation for the mariadb sequence "NOCYCLE" keyword when `Sequence.cycle` is set to False.
- Fixed issue in the aiosqlite driver where SQLAlchemy's setting of the worker thread to "daemon" stopped working due to changes in aiosqlite version 0.22.0.