pymysql 处理pymysql取值带有Decimal和datetime.datatime的数据

from pymysql import converters, FIELD_TYPE

conv = converters.conversions
conv[FIELD_TYPE.NEWDECIMAL] = float # convert decimals to float
conv[FIELD_TYPE.DATE] = str # convert dates to strings
conv[FIELD_TYPE.TIMESTAMP] = str # convert dates to strings
conv[FIELD_TYPE.DATETIME] = str # convert dates to strings
conv[FIELD_TYPE.TIME] = str # convert dates to strings

posted @ 2025-06-27 13:38  赏金猎人小熊  阅读(8)  评论(0)    收藏  举报