lost.
.. change::
- :tags: bug, orm, regression
+ :tags: bug, orm, ression
:tickets: 9232
Fixed obscure ORM inheritance issue caused by :ticket:`8705` where some
:tickets: 5648
The support for pool ping listeners to receive exception events via the
- :meth:`.ConnectionEvents.handle_error` event added in 2.0.0b1 for
+ :meth:`.DialectEvents.handle_error` event added in 2.0.0b1 for
:ticket:`5648` failed to take into account dialect-specific ping routines
such as that of MySQL and PostgreSQL. The dialect feature has been reworked
so that all dialects participate within event handling. Additionally,
name to be fully qualified regardless of whether or not
``from __annotations__ import future`` were present. This issue first fixed
in 2.0.0b3 confirmed that this case worked via the test suite, however the
- test suite apparently was not testing the behavior for the name ``Mapped``
- not being locally present at all; string resolution has been updated to
- ensure the ``Mapped`` symbol is locatable as applies to how the ORM uses
- these functions.
+ test suite apparently was not testing the behavior for the name
+ :class:`_orm.Mapped` not being locally present at all; string resolution
+ has been updated to ensure the :class:`_orm.Mapped` symbol is locatable as
+ applies to how the ORM uses these functions.
:tags: engine, performance
:tickets: 9343
- A small optimization to the Cython implementation of :class:`.ResultProxy`
+ A small optimization to the Cython implementation of :class:`.Result`
using a cdef for a particular int value to avoid Python overhead. Pull
request courtesy Matus Valo.
.. change::
- :tags: bug, schema, postgresql
- :tickets: 9332
+ :tags: bug, postgresql
+ :tickets: 9349
- ExcludeConstraint correctly uses literal compile when compiling
- expression ddl.
+ Fixed issue in PostgreSQL :class:`_postgresql.ExcludeConstraint` where
+ literal values were being compiled as bound parameters and not direct
+ inline values as is required for DDL.
:tags: bug, ext
:tickets: 9367
- Fixed issue in automap where calling ``.prepare()`` from one of the mapped
- classes would not use the correct base class when automap detected new
- tables, instead using the given class, leading to mappers trying to
- configure inheritance. While one should normally call ``.prepare()`` from
- the base in any case, it shouldn't misbehave that badly when called from a
- subclass.
+ Fixed issue in automap where calling :meth:`_automap.AutomapBase.prepare`
+ from a specific mapped class, rather than from the
+ :class:`_automap.AutomapBase` directly, would not use the correct base
+ class when automap detected new tables, instead using the given class,
+ leading to mappers trying to configure inheritance. While one should
+ normally call :meth:`_automap.AutomapBase.prepare` from the base in any
+ case, it shouldn't misbehave that badly when called from a subclass.
:tags: bug, typing
:tickets: 9376
- Improved typing for the mapping passed to :meth:`.UpdateBase.values` to be
- more open-ended about collection type, by indicating read-only ``Mapping``
- instead of writeable ``Dict`` which would error out on too limited of a key
- type.
+ Improved typing for the mapping passed to :meth:`.Insert.values` and
+ :meth:`.Update.values` to be more open-ended about collection type, by
+ indicating read-only ``Mapping`` instead of writeable ``Dict`` which would
+ error out on too limited of a key type.
.. change::
- :tags: bug, sqlite
+ :tags: bug, sqlite, regression
:tickets: 9379
- Fixed bug that prevented SQLAlchemy to connect when using a very old
- sqlite version (before 3.8.3) on python 3.8+.
+ Fixed regression for SQLite connections where use of the ``deterministic``
+ parameter when establishing database functions would fail for older SQLite
+ versions, those prior to version 3.8.3. The version checking logic has been
+ improved to accommodate for this case.
:tags: bug, typing
:tickets: 9391
- Added missing init overload to :class:`_sql.Numeric` to allow
- type checkers to properly resolve the type var given the
- ``asdecimal`` parameter.
+ Added missing init overload to the :class:`_types.Numeric` type object so
+ that pep-484 type checkers may properly resolve the complete type, deriving
+ from the :paramref:`_types.Numeric.asdecimal` parameter whether ``Decimal``
+ or ``float`` objects will be represented.
.. change::
- :tags: bug, schema, postgresql
+ :tags: bug, postgresql
:tickets: 9401
- Fixed issue when copying ExcludeConstraint.
+ Fixed issue where the PostgreSQL :class:`_postgresql.ExcludeConstraint`
+ construct would not be copyable within operations such as
+ :meth:`_schema.Table.to_metadata` as well as within some Alembic scenarios,
+ if the constraint contained textual expression elements.
:tags: bug, engine
:tickets: 9423
- Fixed bug where :meth:`_engine.Row`s could not be
- unpickled by other processes.
+ Fixed bug where :class:`_engine.Row` objects could not be reliably unpickled
+ across processes due to an accidental reliance on an unstable hash value.
.. change::
:tags: schema
- Validate that when provided the :paramref:`_sql.MetaData.schema`
- argument of :class:`_sql.MetaData` is a string.
+ Validate that when provided the :paramref:`_schema.MetaData.schema`
+ argument of :class:`_schema.MetaData` is a string.
make use of a native ``ping()`` method supplied by the DBAPI which does
not make use of disconnect codes.
+ .. versionchanged:: 2.0.0 The :meth:`.DialectEvents.handle_error`
+ event hook participates in connection pool "pre-ping" operations.
+ Within this usage, the :attr:`.ExceptionContext.engine` attribute
+ will be ``None``, however the :class:`.Dialect` in use is always
+ available via the :attr:`.ExceptionContext.dialect` attribute.
+
+ .. versionchanged:: 2.0.5 Added :attr:`.ExceptionContext.is_pre_ping`
+ attribute which will be set to ``True`` when the
+ :meth:`.DialectEvents.handle_error` event hook is triggered within
+ a connection pool pre-ping operation.
+
+ .. versionchanged:: 2.0.5 An issue was repaired that allows for the
+ PostgreSQL ``psycopg`` and ``psycopg2`` drivers, as well as all
+ MySQL drivers, to properly participate in the
+ :meth:`.DialectEvents.handle_error` event hook during
+ connection pool "pre-ping" operations; previously, the
+ implementation was non-working for these drivers.
+
+
A handler function has two options for replacing
the SQLAlchemy-constructed exception into one that is user
defined. It can either raise this new exception directly, in