summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/interfaces.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-05-15 12:35:21 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-05-15 12:38:28 -0400
commitd178707ecaeb547470e2b7b37b9a939abc69cbd0 (patch)
treedc4b674748cf673a123b90797c3525c3a13ef657 /lib/sqlalchemy/engine/interfaces.py
parent64c1f2e5688879e1cc087f4e4a893d32267fd1fb (diff)
downloadsqlalchemy-d178707ecaeb547470e2b7b37b9a939abc69cbd0.tar.gz
- Added support for the case of the misbehaving DBAPI that has
pep-249 exception names linked to exception classes of an entirely different name, preventing SQLAlchemy's own exception wrapping from wrapping the error appropriately. The SQLAlchemy dialect in use needs to implement a new accessor :attr:`.DefaultDialect.dbapi_exception_translation_map` to support this feature; this is implemented now for the py-postgresql dialect. fixes #3421
Diffstat (limited to 'lib/sqlalchemy/engine/interfaces.py')
-rw-r--r--lib/sqlalchemy/engine/interfaces.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py
index 2dd192162..73a8b4635 100644
--- a/lib/sqlalchemy/engine/interfaces.py
+++ b/lib/sqlalchemy/engine/interfaces.py
@@ -150,6 +150,16 @@ class Dialect(object):
This will prevent types.Boolean from generating a CHECK
constraint when that type is used.
+ dbapi_exception_translation_map
+ A dictionary of names that will contain as values the names of
+ pep-249 exceptions ("IntegrityError", "OperationalError", etc)
+ keyed to alternate class names, to support the case where a
+ DBAPI has exception classes that aren't named as they are
+ referred to (e.g. IntegrityError = MyException). In the vast
+ majority of cases this dictionary is empty.
+
+ .. versionadded:: 1.0.5
+
"""
_has_events = False