Skip to content

Commit

Permalink
rename classes
Browse files Browse the repository at this point in the history
  • Loading branch information
altairbow committed Sep 16, 2024
1 parent bc9abdd commit 28d0df2
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions dj_db_conn_pool/backends/jdbc/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import jpype.dbapi2

from dj_db_conn_pool.backends.jdbc.utils import CursorWrapper
from dj_db_conn_pool.core.mixins import PersistentDatabaseWrapperMixin
from dj_db_conn_pool.core.mixins import DatabasePoolWrapperMixin

logger = logging.getLogger(__name__)

Expand All @@ -22,7 +22,7 @@ def do_ping(self, dbapi_connection):
return False


class JDBCDatabaseWrapperMixin(PersistentDatabaseWrapperMixin):
class JDBCDatabaseWrapperMixin(DatabasePoolWrapperMixin):
Database = jpype.dbapi2

@property
Expand Down
4 changes: 2 additions & 2 deletions dj_db_conn_pool/backends/mysql/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from django.db.backends.mysql import base
from sqlalchemy.dialects.mysql.mysqldb import MySQLDialect_mysqldb as MySQLDialect

from dj_db_conn_pool.core.mixins import PersistentDatabaseWrapperMixin
from dj_db_conn_pool.core.mixins import DatabasePoolWrapperMixin

logger = logging.getLogger(__name__)


class DatabaseWrapper(PersistentDatabaseWrapperMixin, base.DatabaseWrapper):
class DatabaseWrapper(DatabasePoolWrapperMixin, base.DatabaseWrapper):
class SQLAlchemyDialect(MySQLDialect):
pass

Expand Down
4 changes: 2 additions & 2 deletions dj_db_conn_pool/backends/odbc/mixins.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pyodbc
from django.conf import ImproperlyConfigured

from dj_db_conn_pool.core.mixins import PersistentDatabaseWrapperMixin
from dj_db_conn_pool.core.mixins import DatabasePoolWrapperMixin


class ODBCWrapperMixin(PersistentDatabaseWrapperMixin):
class ODBCDatabaseWrapperMixin(DatabasePoolWrapperMixin):
def _get_new_connection(self, conn_params):
try:
driver = self.settings_dict['ODBC_OPTIONS']['DRIVER']
Expand Down
4 changes: 2 additions & 2 deletions dj_db_conn_pool/backends/odbc/oceanbase/oracle/base.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from django.db.backends.oracle import base
from sqlalchemy.dialects.oracle.base import OracleDialect

from dj_db_conn_pool.backends.odbc.mixins import ODBCWrapperMixin
from dj_db_conn_pool.backends.odbc.mixins import ODBCDatabaseWrapperMixin


class DatabaseWrapper(ODBCWrapperMixin, base.DatabaseWrapper):
class DatabaseWrapper(ODBCDatabaseWrapperMixin, base.DatabaseWrapper):
class SQLAlchemyDialect(OracleDialect):
pass

Expand Down
4 changes: 2 additions & 2 deletions dj_db_conn_pool/backends/oracle/base.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from django.db.backends.oracle import base
from sqlalchemy.dialects.oracle.base import OracleDialect

from dj_db_conn_pool.core.mixins import PersistentDatabaseWrapperMixin
from dj_db_conn_pool.core.mixins import DatabasePoolWrapperMixin


class DatabaseWrapper(PersistentDatabaseWrapperMixin, base.DatabaseWrapper):
class DatabaseWrapper(DatabasePoolWrapperMixin, base.DatabaseWrapper):
class SQLAlchemyDialect(OracleDialect):
pass

Expand Down
4 changes: 2 additions & 2 deletions dj_db_conn_pool/backends/postgresql/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
except ModuleNotFoundError:
from sqlalchemy.dialects.postgresql.psycopg2 import PGDialect_psycopg2 as PGDialect

from dj_db_conn_pool.core.mixins import PersistentDatabaseWrapperMixin
from dj_db_conn_pool.core.mixins import DatabasePoolWrapperMixin


class PGDatabaseWrapperMixin(PersistentDatabaseWrapperMixin):
class PGDatabaseWrapperMixin(DatabasePoolWrapperMixin):
class SQLAlchemyDialect(PGDialect):
pass

Expand Down
4 changes: 2 additions & 2 deletions dj_db_conn_pool/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
from django.db.backends.base.operations import BaseDatabaseOperations
from sqlalchemy.engine.default import DefaultDialect

from dj_db_conn_pool.core.mixins.core import PersistentDatabaseWrapperMixin
from dj_db_conn_pool.core.mixins.core import DatabasePoolWrapperMixin

logger = logging.getLogger(__name__)


class BaseDatabasePoolWrapper(PersistentDatabaseWrapperMixin, base.BaseDatabaseWrapper):
class BaseDatabasePoolWrapper(DatabasePoolWrapperMixin, base.BaseDatabaseWrapper):
client_class = BaseDatabaseClient

creation_class = BaseDatabaseCreation
Expand Down
2 changes: 1 addition & 1 deletion dj_db_conn_pool/core/mixins/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .core import PersistentDatabaseWrapperMixin
from .core import DatabasePoolWrapperMixin
2 changes: 1 addition & 1 deletion dj_db_conn_pool/core/mixins/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
logger = logging.getLogger(__name__)


class PersistentDatabaseWrapperMixin:
class DatabasePoolWrapperMixin:
def __init__(self, *args, **kwargs):
# override creation_class
self.creation_class = type('DatabaseCreationWrapper', (DatabaseCreationMixin, self.creation_class), {})
Expand Down

0 comments on commit 28d0df2

Please sign in to comment.