class AsyncAdapt_asyncmy_dbapi:
- def __init__(self, asyncmy, pymysql):
+ def __init__(self, asyncmy):
self.asyncmy = asyncmy
- self.pymysql = pymysql
self.paramstyle = "format"
self._init_dbapi_attributes()
):
setattr(self, name, getattr(self.asyncmy.errors, name))
- for name in (
- "NUMBER",
- "STRING",
- "DATETIME",
- "BINARY",
- "TIMESTAMP",
- "Binary",
- ):
- setattr(self, name, getattr(self.pymysql, name))
-
def connect(self, *arg, **kw):
async_fallback = kw.pop("async_fallback", False)
@classmethod
def dbapi(cls):
- return AsyncAdapt_asyncmy_dbapi(
- __import__("asyncmy"), __import__("pymysql")
- )
+ return AsyncAdapt_asyncmy_dbapi(__import__("asyncmy"))
@classmethod
def get_pool_class(cls, url):
)
def _found_rows_client_flag(self):
- from pymysql.constants import CLIENT
+ from asyncmy.constants import CLIENT
return CLIENT.FOUND_ROWS