#NEWLINE# @ has_access #NEWLINE# @ expose ( '/testconn' , methods = [ 'POST' , 'GET' ] ) #NEWLINE# def testconn( self ) : #NEWLINE# #INDENT# 'Tests a sqla connection' #NEWLINE# try : #NEWLINE# #INDENT# uri = request . json . get ( 'uri' ) #NEWLINE# connect_args = request . json . get ( 'extras' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) . get ( 'engine_params' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) . get ( 'connect_args' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# engine = create_engine ( uri , connect_args = connect_args ) #NEWLINE# engine . connect ( ) #NEWLINE# return json . dumps ( engine . table_names ( ) , indent = 4 ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# return Response ( traceback . format_exc ( ) , status = 500 , mimetype = 'application/json' )