转换编辑器查询sql返回结果的类型, 否则fastapi会报错.

Update api_editor_v1.py
This commit is contained in:
曲奇饼
2023-09-28 16:32:37 +08:00
committed by GitHub
parent 20bdddec51
commit 6ec69589de

View File

@@ -120,6 +120,8 @@ async def editor_sql_run(run_param: dict = Body()):
try: try:
start_time = time.time() * 1000 start_time = time.time() * 1000
colunms, sql_result = conn.query_ex(sql) colunms, sql_result = conn.query_ex(sql)
# 转换结果类型
sql_result = [tuple(x) for x in sql_result]
# 计算执行耗时 # 计算执行耗时
end_time = time.time() * 1000 end_time = time.time() * 1000
sql_run_data: SqlRunData = SqlRunData( sql_run_data: SqlRunData = SqlRunData(