File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 2626def get_datasource_list (session : SessionDep , user : CurrentUser ):
2727 oid = user .oid if user .oid is not None else 1
2828 return session .query (CoreDatasource ).filter (CoreDatasource .oid == oid ).order_by (
29- func .convert_to (CoreDatasource .name , 'gbk' )).all ()
29+ func .convert_to (CoreDatasource .name , 'gbk' )).all ()
3030
3131
3232def get_ds (session : SessionDep , id : int ):
@@ -42,6 +42,7 @@ def check_status(session: SessionDep, ds: CoreDatasource):
4242 print ("success" )
4343 return True
4444 except Exception as e :
45+ raise HTTPException (status_code = 500 , detail = e .args )
4546 print ("Fail:" , e )
4647 return False
4748
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ def get_engine(ds: CoreDatasource) -> Engine:
5858 conf .timeout = 30
5959 if ds .type == "pg" and (conf .dbSchema is not None and conf .dbSchema != "" ):
6060 engine = create_engine (get_uri (ds ),
61- connect_args = {"options" : f"-c search_path={ conf .dbSchema } " ,
61+ connect_args = {"options" : f"-c search_path={ urllib . parse . quote ( conf .dbSchema ) } " ,
6262 "connect_timeout" : conf .timeout },
6363 pool_timeout = conf .timeout , pool_size = 20 , max_overflow = 10 )
6464 elif ds .type == 'sqlServer' :
You can’t perform that action at this time.
0 commit comments