Skip to content

Commit 612b002

Browse files
committed
refactor: assistant support all sqlbot datasource #467
1 parent 955c9be commit 612b002

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

backend/apps/system/crud/assistant.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,15 @@ def get_ds_engine(ds: AssistantOutDsSchema) -> Engine:
271271

272272
def get_out_ds_conf(ds: AssistantOutDsSchema, timeout:int=30) -> str:
273273
conf = {
274-
"host":ds.host,
275-
"port":ds.port,
276-
"username":ds.user,
277-
"password":ds.password,
278-
"database":ds.dataBase,
274+
"host":ds.host or '',
275+
"port":ds.port or 0,
276+
"username":ds.user or '',
277+
"password":ds.password or '',
278+
"database":ds.dataBase or '',
279279
"driver":'',
280280
"extraJdbc":ds.extraParams or '',
281281
"dbSchema":ds.db_schema or '',
282-
"timeout":timeout
282+
"timeout":timeout or 30
283283
}
284284
conf["extraJdbc"] = ''
285285
return aes_encrypt(json.dumps(conf))

0 commit comments

Comments
 (0)