sqlor/dataloader/t.py

25 lines
617 B
Python
Raw Normal View History

2024-09-23 14:19:50 +08:00
from appPublic.jsonConfig import getConfig
import openpyxl as xlsx
import asyncio
from sqlor.dbpools import DBPools
import aiomysql
import aiopg
from typeconv import convrec
async def test():
db = DBPools()
async with db.sqlorContext('kboss') as sor:
recs = await sor.R('appcodes', {})
a = recs[0]['create_at']
print('a=', a, type(a), dir(a), '%020d' % int(a.timestamp()*1000))
if __name__ == '__main__':
import sys
import os
p = os.getcwd()
config = getConfig(p)
print(f'{config.databases=},cwd={p}')
db = DBPools(config.databases)
loop = asyncio.get_event_loop()
loop.run_until_complete(test())