Convert the type of the result returned by the SQL Editor query (#647)

Convert the SQL editor execution result to Tuple, otherwise FastAPI will
report an error.
fastapi: 0.99.1
DB-GPT: main branch
This commit is contained in:
magic.chen 2023-10-07 17:48:48 +08:00 committed by GitHub
commit 85e32f79ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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