Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions backend/apps/system/crud/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ def get_ds(self, ds_id: int, trans: Trans = None):

def convert2schema(self, ds_dict: dict, config: dict[any]) -> AssistantOutDsSchema:
id_marker: str = ''
attr_list = ['name', 'type', 'host', 'port', 'user', 'dataBase', 'schema']
attr_list = ['name', 'type', 'host', 'port', 'user', 'dataBase', 'schema', 'mode']
if config.get('encrypt', False):
key = config.get('aes_key', None)
iv = config.get('aes_iv', None)
aes_attrs = ['host', 'user', 'password', 'dataBase', 'db_schema', 'schema']
aes_attrs = ['host', 'user', 'password', 'dataBase', 'db_schema', 'schema', 'mode']
for attr in aes_attrs:
if attr in ds_dict and ds_dict[attr]:
try:
Expand Down Expand Up @@ -268,7 +268,8 @@ def get_out_ds_conf(ds: AssistantOutDsSchema, timeout: int = 30) -> str:
"driver": '',
"extraJdbc": ds.extraParams or '',
"dbSchema": ds.db_schema or '',
"timeout": timeout or 30
"timeout": timeout or 30,
"mode": ds.mode or ''
}
conf["extraJdbc"] = ''
return aes_encrypt(json.dumps(conf))
1 change: 1 addition & 0 deletions backend/apps/system/schemas/system_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ class AssistantOutDsSchema(AssistantOutDsBase):
password: Optional[str] = None
db_schema: Optional[str] = None
extraParams: Optional[str] = None
mode: Optional[str] = None
tables: Optional[list[AssistantTableSchema]] = None


Expand Down