Skip to content

Commit 68e0a1f

Browse files
dungdm93hashhar
authored andcommitted
Export dbapi globals and exceptions as specified in PEP-0249
See https://www.python.org/dev/peps/pep-0249/#globals and https://www.python.org/dev/peps/pep-0249/#exceptions.
1 parent 61de1e1 commit 68e0a1f

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

trino/dbapi.py

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,39 @@
3030
import trino.client
3131
import trino.logging
3232
from trino.transaction import Transaction, IsolationLevel, NO_TRANSACTION
33+
from trino.exceptions import (
34+
Warning,
35+
Error,
36+
InterfaceError,
37+
DatabaseError,
38+
DataError,
39+
OperationalError,
40+
IntegrityError,
41+
InternalError,
42+
ProgrammingError,
43+
NotSupportedError,
44+
)
3345

34-
35-
__all__ = ["connect", "Connection", "Cursor"]
46+
__all__ = [
47+
# https://www.python.org/dev/peps/pep-0249/#globals
48+
"apilevel",
49+
"threadsafety",
50+
"paramstyle",
51+
"connect",
52+
"Connection",
53+
"Cursor",
54+
# https://www.python.org/dev/peps/pep-0249/#exceptions
55+
"Warning",
56+
"Error",
57+
"InterfaceError",
58+
"DatabaseError",
59+
"DataError",
60+
"OperationalError",
61+
"IntegrityError",
62+
"InternalError",
63+
"ProgrammingError",
64+
"NotSupportedError",
65+
]
3666

3767

3868
apilevel = "2.0"

0 commit comments

Comments
 (0)