import logging
-from . import pq
+from . import pq # noqa: F401 import early to stabilize side effects
from . import types
from . import postgres
from .copy import Copy, AsyncCopy
from . import dbapi20
from .dbapi20 import BINARY, DATETIME, NUMBER, ROWID, STRING
-from .dbapi20 import Binary, BinaryTextDumper, BinaryBinaryDumper
-from .dbapi20 import Date, DateFromTicks, Time, TimeFromTicks
+from .dbapi20 import Binary, Date, DateFromTicks, Time, TimeFromTicks
from .dbapi20 import Timestamp, TimestampFromTicks
from .version import __version__
if logger.level == logging.NOTSET:
logger.setLevel(logging.WARNING)
-# register default adapters for PostgreSQL
-adapters = postgres.adapters # exposed by the package
-
# DBAPI compliancy
connect = Connection.connect
apilevel = "2.0"
threadsafety = 2
paramstyle = "pyformat"
+# register default adapters for PostgreSQL
+adapters = postgres.adapters # exposed by the package
postgres.register_default_adapters(adapters)
-# After the default one because they can deal with the bytea oid better
+# After the default ones, because these can deal with the bytea oid better
dbapi20.register_dbapi20_adapters(adapters)
-# Must come after all the types are registered
+# Must come after all the types have been registered
types.array.register_all_arrays(adapters)
# Note: defining the exported methods helps both Sphynx in documenting that
"BaseConnection",
"Column",
"Connection",
+ "ConnectionInfo",
"Copy",
"Cursor",
"IsolationLevel",
"ProgrammingError",
"NotSupportedError",
# DBAPI type constructors and singletons
+ "Binary",
"Date",
- "Time",
- "Timestamp",
"DateFromTicks",
+ "Time",
"TimeFromTicks",
+ "Timestamp",
"TimestampFromTicks",
- "Binary",
- "STRING",
"BINARY",
- "NUMBER",
"DATETIME",
+ "NUMBER",
"ROWID",
+ "STRING",
]