mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-10 18:26:55 +08:00
perf: Optimize DataEase integration with Advanced Assistant
This commit is contained in:
committed by
fit2cloud-chenyw
parent
e626d13971
commit
b9ce9d3ddf
@@ -195,7 +195,7 @@ async def ds(session: SessionDep, current_assistant: CurrentAssistant):
|
||||
out_ds_instance: AssistantOutDs = AssistantOutDsFactory.get_instance(current_assistant)
|
||||
return [
|
||||
{
|
||||
"id": ds.id,
|
||||
"id": str(ds.id),
|
||||
"name": ds.name,
|
||||
"description": ds.description or ds.comment,
|
||||
"type": ds.type,
|
||||
|
||||
@@ -240,10 +240,13 @@ class AssistantOutDs:
|
||||
except Exception as e:
|
||||
raise Exception(
|
||||
f"Failed to encrypt {attr} for datasource {ds_dict.get('name')}, error: {str(e)}")
|
||||
for attr in attr_list:
|
||||
if attr in ds_dict:
|
||||
id_marker += str(ds_dict.get(attr, '')) + '--sqlbot--'
|
||||
id = string_to_numeric_hash(id_marker)
|
||||
|
||||
id = ds_dict.get('id', None)
|
||||
if not id:
|
||||
for attr in attr_list:
|
||||
if attr in ds_dict:
|
||||
id_marker += str(ds_dict.get(attr, '')) + '--sqlbot--'
|
||||
id = string_to_numeric_hash(id_marker)
|
||||
db_schema = ds_dict.get('schema', ds_dict.get('db_schema', ''))
|
||||
ds_dict.pop("schema", None)
|
||||
return AssistantOutDsSchema(**{**ds_dict, "id": id, "db_schema": db_schema})
|
||||
|
||||
Reference in New Issue
Block a user