bugfix
This commit is contained in:
parent
a7f651888b
commit
cb4bb508d3
@ -1,8 +1,7 @@
|
||||
# -*- coding:utf8 -*-
|
||||
from appPublic.argsConvert import ArgsConvert,ConditionConvert
|
||||
|
||||
import aiomysql
|
||||
from .sor import SQLor
|
||||
from .const import ROWS
|
||||
from .ddl_template_mysql import mysql_ddl_tmpl
|
||||
class MySqlor(SQLor):
|
||||
ddl_template = mysql_ddl_tmpl
|
||||
@ -141,3 +140,22 @@ WHERE
|
||||
if tablename is not None:
|
||||
sqlcmd = sqlcmd + """ AND table_name = '%s'""" % tablename.lower()
|
||||
return sqlcmd
|
||||
|
||||
async def connect():
|
||||
"""
|
||||
kwargs:
|
||||
host:
|
||||
port:
|
||||
user:
|
||||
password:
|
||||
db:
|
||||
"""
|
||||
dbdesc = self.dbdesc
|
||||
self.conn = await aiomysql.connect(**desc['kwargs])
|
||||
self.cur = await self.cursor()
|
||||
aelf.dbname = desc['kwargs']['db']
|
||||
|
||||
async def close():
|
||||
await self.cursor.close()
|
||||
await self.conn.close()
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import aiopg
|
||||
from .sor import SQLor
|
||||
from .ddl_template_postgresql import postgresql_ddl_tmpl
|
||||
|
||||
@ -169,3 +170,21 @@ order by
|
||||
i.relname""" % tablename.lower()
|
||||
return sqlcmd
|
||||
|
||||
async def connect():
|
||||
"""
|
||||
kwargs:
|
||||
dbname:
|
||||
user:
|
||||
password:
|
||||
host:
|
||||
port:
|
||||
"""
|
||||
kwargs = self.dbdesc
|
||||
self.conn = await self.connect(**kwargs)
|
||||
self.cur = await self.conn.cursor()
|
||||
self.dbname = kwargs['dbname']
|
||||
|
||||
async def close():
|
||||
await self.cur.close()
|
||||
await self.conn.close()
|
||||
|
||||
|
||||
@ -680,3 +680,5 @@ class SQLor(object):
|
||||
ns = await rf.exe(f'{self.dbname}:{tablename}:d:after', ns)
|
||||
return r
|
||||
|
||||
async def connect(desc):
|
||||
raise Exception('Not Implemented')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user