This commit is contained in:
yumoqing 2025-10-19 18:19:17 +08:00
parent 08ffd2ef08
commit 0a75d57225

View File

@ -443,13 +443,20 @@ class SQLor(object):
return await self.execute(desc,NS,None) return await self.execute(desc,NS,None)
async def sqlExe(self, sql, ns): async def sqlExe(self, sql, ns):
ret = []
r = await self.execute(sql,ns,
callback=lambda x:ret.append(x))
sqltype = self.getSqlType(sql) sqltype = self.getSqlType(sql)
if sqltype == 'dml': if sqltype != 'qry':
r = await self.execute(sql, ns)
return r return r
if 'page' in ns.keys():
cnt = await self.record_count(sql, ns)
rows = await self.pagingdata(sql, ns)
return {
'total': cnt,
'rows': rows
}
ret = []
async for r in self._get_data(sql, ns):
ret.append(r)
return ret return ret
async def sqlPaging(self,sql,ns): async def sqlPaging(self,sql,ns):