|
10 | 10 |
|
11 | 11 | .. changelog:: |
12 | 12 | :version: 2.0.42 |
13 | | - :include_notes_from: unreleased_20 |
| 13 | + :released: July 29, 2025 |
| 14 | + |
| 15 | + .. change:: |
| 16 | + :tags: usecase, orm |
| 17 | + :tickets: 10674 |
| 18 | + |
| 19 | + Added ``dataclass_metadata`` argument to all ORM attribute constructors |
| 20 | + that accept dataclasses parameters, e.g. :paramref:`.mapped_column.dataclass_metadata`, |
| 21 | + :paramref:`.relationship.dataclass_metadata`, etc. |
| 22 | + It's passed to the underlying dataclass ``metadata`` attribute |
| 23 | + of the dataclass field. Pull request courtesy Sigmund Lahn. |
| 24 | + |
| 25 | + .. change:: |
| 26 | + :tags: usecase, postgresql |
| 27 | + :tickets: 10927 |
| 28 | + |
| 29 | + Added support for PostgreSQL 14+ JSONB subscripting syntax. When connected |
| 30 | + to PostgreSQL 14 or later, JSONB columns now automatically use the native |
| 31 | + subscript notation ``jsonb_col['key']`` instead of the arrow operator |
| 32 | + ``jsonb_col -> 'key'`` for both read and write operations. This provides |
| 33 | + better compatibility with PostgreSQL's native JSONB subscripting feature |
| 34 | + while maintaining backward compatibility with older PostgreSQL versions. |
| 35 | + JSON columns continue to use the traditional arrow syntax regardless of |
| 36 | + PostgreSQL version. |
| 37 | + |
| 38 | + .. change:: |
| 39 | + :tags: bug, orm |
| 40 | + :tickets: 12593 |
| 41 | + |
| 42 | + Implemented the :func:`_orm.defer`, :func:`_orm.undefer` and |
| 43 | + :func:`_orm.load_only` loader options to work for composite attributes, a |
| 44 | + use case that had never been supported previously. |
| 45 | + |
| 46 | + .. change:: |
| 47 | + :tags: bug, postgresql, reflection |
| 48 | + :tickets: 12600 |
| 49 | + |
| 50 | + Fixed regression caused by :ticket:`10665` where the newly modified |
| 51 | + constraint reflection query would fail on older versions of PostgreSQL |
| 52 | + such as version 9.6. Pull request courtesy Denis Laxalde. |
| 53 | + |
| 54 | + .. change:: |
| 55 | + :tags: bug, mysql |
| 56 | + :tickets: 12648 |
| 57 | + |
| 58 | + Fixed yet another regression caused by by the DEFAULT rendering changes in |
| 59 | + 2.0.40 :ticket:`12425`, similar to :ticket:`12488`, this time where using a |
| 60 | + CURRENT_TIMESTAMP function with a fractional seconds portion inside a |
| 61 | + textual default value would also fail to be recognized as a |
| 62 | + non-parenthesized server default. |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + .. change:: |
| 67 | + :tags: bug, mssql |
| 68 | + :tickets: 12654 |
| 69 | + |
| 70 | + Reworked SQL Server column reflection to be based on the ``sys.columns`` |
| 71 | + table rather than ``information_schema.columns`` view. By correctly using |
| 72 | + the SQL Server ``object_id()`` function as a lead and joining to related |
| 73 | + tables on object_id rather than names, this repairs a variety of issues in |
| 74 | + SQL Server reflection, including: |
| 75 | + |
| 76 | + * Issue where reflected column comments would not correctly line up |
| 77 | + with the columns themselves in the case that the table had been ALTERed |
| 78 | + * Correctly targets tables with awkward names such as names with brackets, |
| 79 | + when reflecting not just the basic table / columns but also extended |
| 80 | + information including IDENTITY, computed columns, comments which |
| 81 | + did not work previously |
| 82 | + * Correctly targets IDENTITY, computed status from temporary tables |
| 83 | + which did not work previously |
| 84 | + |
| 85 | + .. change:: |
| 86 | + :tags: bug, sql |
| 87 | + :tickets: 12681 |
| 88 | + |
| 89 | + Fixed issue where :func:`.select` of a free-standing scalar expression that |
| 90 | + has a unary operator applied, such as negation, would not apply result |
| 91 | + processors to the selected column even though the correct type remains in |
| 92 | + place for the unary expression. |
| 93 | + |
| 94 | + |
| 95 | + .. change:: |
| 96 | + :tags: bug, sql |
| 97 | + :tickets: 12692 |
| 98 | + |
| 99 | + Hardening of the compiler's actions for UPDATE statements that access |
| 100 | + multiple tables to report more specifically when tables or aliases are |
| 101 | + referenced in the SET clause; on cases where the backend does not support |
| 102 | + secondary tables in the SET clause, an explicit error is raised, and on the |
| 103 | + MySQL or similar backends that support such a SET clause, more specific |
| 104 | + checking for not-properly-included tables is performed. Overall the change |
| 105 | + is preventing these erroneous forms of UPDATE statements from being |
| 106 | + compiled, whereas previously it was relied on the database to raise an |
| 107 | + error, which was not always guaranteed to happen, or to be non-ambiguous, |
| 108 | + due to cases where the parent table included the same column name as the |
| 109 | + secondary table column being updated. |
| 110 | + |
| 111 | + |
| 112 | + .. change:: |
| 113 | + :tags: bug, orm |
| 114 | + :tickets: 12692 |
| 115 | + |
| 116 | + Fixed bug where the ORM would pull in the wrong column into an UPDATE when |
| 117 | + a key name inside of the :meth:`.ValuesBase.values` method could be located |
| 118 | + from an ORM entity mentioned in the statement, but where that ORM entity |
| 119 | + was not the actual table that the statement was inserting or updating. An |
| 120 | + extra check for this edge case is added to avoid this problem. |
| 121 | + |
| 122 | + .. change:: |
| 123 | + :tags: bug, postgresql |
| 124 | + :tickets: 12728 |
| 125 | + |
| 126 | + Re-raise catched ``CancelledError`` in the terminate method of the |
| 127 | + asyncpg dialect to avoid possible hangs of the code execution. |
| 128 | + |
| 129 | + |
| 130 | + .. change:: |
| 131 | + :tags: usecase, sql |
| 132 | + :tickets: 12734 |
| 133 | + |
| 134 | + The :func:`_sql.values` construct gains a new method :meth:`_sql.Values.cte`, |
| 135 | + which allows creation of a named, explicit-columns :class:`.CTE` against an |
| 136 | + unnamed ``VALUES`` expression, producing a syntax that allows column-oriented |
| 137 | + selection from a ``VALUES`` construct on modern versions of PostgreSQL, SQLite, |
| 138 | + and MariaDB. |
| 139 | + |
| 140 | + .. change:: |
| 141 | + :tags: bug, reflection, postgresql |
| 142 | + :tickets: 12744 |
| 143 | + |
| 144 | + Fixes bug that would mistakenly interpret a domain or enum type |
| 145 | + with name starting in ``interval`` as an ``INTERVAL`` type while |
| 146 | + reflecting a table. |
| 147 | + |
| 148 | + .. change:: |
| 149 | + :tags: usecase, postgresql |
| 150 | + :tickets: 8664 |
| 151 | + |
| 152 | + Added ``postgresql_ops`` key to the ``dialect_options`` entry in reflected |
| 153 | + dictionary. This maps names of columns used in the index to respective |
| 154 | + operator class, if distinct from the default one for column's data type. |
| 155 | + Pull request courtesy Denis Laxalde. |
| 156 | + |
| 157 | + .. seealso:: |
| 158 | + |
| 159 | + :ref:`postgresql_operator_classes` |
| 160 | + |
| 161 | + .. change:: |
| 162 | + :tags: engine |
| 163 | + |
| 164 | + Improved validation of execution parameters passed to the |
| 165 | + :meth:`_engine.Connection.execute` and similar methods to |
| 166 | + provided a better error when tuples are passed in. |
| 167 | + Previously the execution would fail with a difficult to |
| 168 | + understand error message. |
14 | 169 |
|
15 | 170 | .. changelog:: |
16 | 171 | :version: 2.0.41 |
|
0 commit comments