From 246ebad120a8e5d434fe03b6daddb391aaf19547 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 19 Apr 2023 14:50:25 +0800 Subject: [PATCH] bugfix --- dataloader/dataloader.py | 2 ++ sqlor/sor.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/dataloader/dataloader.py b/dataloader/dataloader.py index 4f1be06..7953e77 100755 --- a/dataloader/dataloader.py +++ b/dataloader/dataloader.py @@ -2,6 +2,8 @@ from appPublic.jsonConfig import getConfig import openpyxl as xlsx import asyncio from sqlor.dbpools import DBPools +import aiomysql +import aiopg from typeconv import convrec class CBObject: diff --git a/sqlor/sor.py b/sqlor/sor.py index 1fbc220..ea5392b 100755 --- a/sqlor/sor.py +++ b/sqlor/sor.py @@ -4,6 +4,7 @@ import decimal from asyncio import coroutine os.environ['NLS_LANG'] = 'SIMPLIFIED CHINESE_CHINA.UTF8' import sys +from datetime import datetime, date import codecs import re import json @@ -17,6 +18,10 @@ from .filter import DBFilter def db_type_2_py_type(o): if isinstance(o,decimal.Decimal): return float(o) + if isinstance(o,datetime): + return '%020d' % int(o.timestamp() * 1000) + if isinstance(o, date): + return '%04d-%02d-%02d' % (o.year, o.month, o.day) return o class SQLorException(Exception,object):