2.0.47
Released: February 24, 2026
orm
-
[orm] [bug] Fixed issue when using ORM mappings with Python 3.14's PEP 649 feature that no longer requires "future annotations", where the ORM's introspection of the
__init__method of mapped classes would fail if non-present identifiers in annotations were present. The vendoredgetfullargspec()method has been amended to useFormat.FORWARDREFunder Python 3.14 to prevent resolution of names that aren't present.References: #13104
engine
-
[engine] [usecase] The connection object returned by
_engine.Engine.raw_connection()now supports the context manager protocol, automatically returning the connection to the pool when exiting the context.References: #13116
postgresql
-
[postgresql] [bug] Fixed an issue in the PostgreSQL dialect where foreign key constraint reflection would incorrectly swap or fail to capture
onupdateandondeletevalues when these clauses appeared in a different order than expected in the constraint definition. This issue primarily affected PostgreSQL-compatible databases such as CockroachDB, which may returnON DELETEbeforeON UPDATEin the constraint definition string. The reflection logic now correctly parses both clauses regardless of their ordering.References: #13105
-
[postgresql] [bug] Fixed issue in the
engine_insertmanyvaluesfeature where using PostgreSQL'sON CONFLICTclause with_dml.Insert.returning.sort_by_parameter_orderenabled would generate invalid SQL when the insert used an implicit sentinel (server-side autoincrement primary key). The generated SQL would incorrectly declare a sentinel counter column in theimp_sentable alias without providing corresponding values in theVALUESclause, leading to aProgrammingErrorindicating column count mismatch. The fix allows batch execution mode whenembed_values_counteris active, as the embedded counter provides the ordering capability needed even with upsert behaviors, rather than unnecessarily downgrading to row-at-a-time execution.References: #13107
-
[postgresql] [bug] Fixed issue where
_postgresql.Insert.on_conflict_do_update()parameters were not respecting compilation options such asliteral_binds=True. Pull request courtesy Loïc Simon.References: #13110
-
[postgresql] [bug] Fixed issue where
_postgresql.Insert.on_conflict_do_update()using parametrized bound parameters in theset_clause would fail when used with executemany batching. For dialects that use theuse_insertmanyvalues_wo_returningoptimization (psycopg2), insertmanyvalues is now disabled when there is an ON CONFLICT clause. For cases with RETURNING, row-at-a-time mode is used when the SET clause contains parametrized bindparams (bindparams that receive values from the parameters dict), ensuring each row's parameters are correctly applied. ON CONFLICT statements using expressions likeexcluded.<column>continue to batch normally.References: #13130
mysql
-
[mysql] [bug] Fixed issue where DDL compilation options were registered to the hard-coded dialect name
mysql. This made it awkward for MySQL-derived dialects like MariaDB, StarRocks, etc. to work with such options when different sets of options exist for different platforms. Options are now registered under the actual dialect name, and a fallback was added to help avoid errors when an option does not exist for that dialect.To maintain backwards compatibility, when using the MariaDB dialect with the options
mysql_with_parserormysql_usingwithout also specifying the correspondingmariadb_prefixed options, a deprecation warning will be emitted. Themysql_prefixed options will continue to work during the deprecation period. Users should update their code to additionally specifymariadb_with_parserandmariadb_usingwhen using themariadb://dialect, or specify both options to support both dialects.Pull request courtesy Tiansu Yu.
References: #13134
sqlite
-
[sqlite] [bug] Fixed issue where
_sqlite.Insert.on_conflict_do_update()parameters were not respecting compilation options such asliteral_binds=True. Pull request courtesy Loïc Simon.References: #13110
-
[sqlite] [bug] Fixed issue where
_sqlite.Insert.on_conflict_do_update()using parametrized bound parameters in theset_clause would fail when used with executemany batching. Row-at-a-time mode is now used for ON CONFLICT statements with RETURNING that contain parametrized bindparams, ensuring each row's parameters are correctly applied. ON CONFLICT statements using expressions likeexcluded.<column>continue to batch normally.References: #13130