From 49f8ec4bcbaf7b1fa65eb69073d15dba76562cc9 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 5 Mar 2023 19:54:30 -0500 Subject: (lots of) changelog updates for 2.0.5 Change-Id: Iea2ca2cd1eb44b4e9139f2bb6c3d6239f67aeb56 --- lib/sqlalchemy/engine/events.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/sqlalchemy/engine') diff --git a/lib/sqlalchemy/engine/events.py b/lib/sqlalchemy/engine/events.py index b906389a9..9028c8c33 100644 --- a/lib/sqlalchemy/engine/events.py +++ b/lib/sqlalchemy/engine/events.py @@ -744,6 +744,25 @@ class DialectEvents(event.Events[Dialect]): 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 -- cgit v1.2.1