File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 55
66from chdb import connect
77
8- enable_print = False
98db_path = "test_db_3fdds"
109
1110
@@ -271,6 +270,23 @@ def test_multiple_connections(self):
271270 conn1 .close ()
272271 conn2 .close ()
273272
273+ def test_connection_properties (self ):
274+ # conn = connect("{db_path}?log_queries=1&verbose=1&log-level=test")
275+ with self .assertRaises (Exception ):
276+ conn = connect (f"{ db_path } ?not_exist_flag=1" )
277+ with self .assertRaises (Exception ):
278+ conn = connect (f"{ db_path } ?verbose=1" )
279+
280+ conn = connect (f"{ db_path } ?verbose&log-level=test" )
281+ ret = conn .query ("SELECT 123" , "CSV" )
282+ print (ret )
283+ print (len (ret ))
284+ self .assertEqual (str (ret ), "123\n " )
285+ ret = conn .query ("show tables in system" , "CSV" )
286+ self .assertGreater (len (ret ), 10 )
287+
288+ conn .close ()
289+
274290
275291if __name__ == "__main__" :
276292 unittest .main ()
You can’t perform that action at this time.
0 commit comments