Skip to content

Commit cb633cb

Browse files
committed
fix: assistant support oracle connection mode
1 parent 4805262 commit cb633cb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

backend/apps/system/crud/assistant.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,11 @@ def get_ds(self, ds_id: int, trans: Trans = None):
228228

229229
def convert2schema(self, ds_dict: dict, config: dict[any]) -> AssistantOutDsSchema:
230230
id_marker: str = ''
231-
attr_list = ['name', 'type', 'host', 'port', 'user', 'dataBase', 'schema']
231+
attr_list = ['name', 'type', 'host', 'port', 'user', 'dataBase', 'schema', 'mode']
232232
if config.get('encrypt', False):
233233
key = config.get('aes_key', None)
234234
iv = config.get('aes_iv', None)
235-
aes_attrs = ['host', 'user', 'password', 'dataBase', 'db_schema', 'schema']
235+
aes_attrs = ['host', 'user', 'password', 'dataBase', 'db_schema', 'schema', 'mode']
236236
for attr in aes_attrs:
237237
if attr in ds_dict and ds_dict[attr]:
238238
try:
@@ -268,7 +268,8 @@ def get_out_ds_conf(ds: AssistantOutDsSchema, timeout: int = 30) -> str:
268268
"driver": '',
269269
"extraJdbc": ds.extraParams or '',
270270
"dbSchema": ds.db_schema or '',
271-
"timeout": timeout or 30
271+
"timeout": timeout or 30,
272+
"mode": ds.mode or ''
272273
}
273274
conf["extraJdbc"] = ''
274275
return aes_encrypt(json.dumps(conf))

backend/apps/system/schemas/system_schema.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ class AssistantOutDsSchema(AssistantOutDsBase):
193193
password: Optional[str] = None
194194
db_schema: Optional[str] = None
195195
extraParams: Optional[str] = None
196+
mode: Optional[str] = None
196197
tables: Optional[list[AssistantTableSchema]] = None
197198

198199

0 commit comments

Comments
 (0)