Commit 28ce76f 1 parent 11e9ec7 commit 28ce76f Copy full SHA for 28ce76f
File tree 2 files changed +10
-2
lines changed
dj_db_conn_pool/backends/postgresql
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
# coding: utf-8
2
+ import importlib
3
+
4
+ try :
5
+ importlib .import_module ("psycopg" )
6
+ from sqlalchemy .dialects .postgresql .psycopg import PGDialect_psycopg as PGDialect
7
+ except ModuleNotFoundError :
8
+ from sqlalchemy .dialects .postgresql .psycopg2 import PGDialect_psycopg2 as PGDialect
2
9
3
- from sqlalchemy .dialects .postgresql .psycopg2 import PGDialect_psycopg2
4
10
5
11
from dj_db_conn_pool .core .mixins import PersistentDatabaseWrapperMixin
6
12
7
13
8
14
class PGDatabaseWrapperMixin (PersistentDatabaseWrapperMixin ):
9
- class SQLAlchemyDialect (PGDialect_psycopg2 ):
15
+ class SQLAlchemyDialect (PGDialect ):
10
16
pass
11
17
12
18
def get_new_connection (self , conn_params ):
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ mysql = ["mysqlclient>=1.3.0"]
44
44
odbc = [" pyodbc>=4.0.34" ]
45
45
oracle = [" cx-Oracle>=6.4.1" ]
46
46
postgresql = [" psycopg2>=2.8.6" ]
47
+ psycopg2 = [" psycopg2>=2.8.6" ]
48
+ psycopg3 = [" psycopg>=3" ]
47
49
48
50
[build-system ]
49
51
requires = [" setuptools" ]
You can’t perform that action at this time.
0 commit comments