@@ -776,7 +776,10 @@ def output_res(results: Generator[SQLResult], start: float) -> None:
776776 nonlocal mutating
777777 result_count = 0
778778 for result in results :
779- title , cur , headers , status = result .get_output ()
779+ title = result .title
780+ cur = result .results
781+ headers = result .headers
782+ status = result .status
780783 command = result .command
781784 logger .debug ("title: %r" , title )
782785 logger .debug ("headers: %r" , headers )
@@ -793,7 +796,7 @@ def output_res(results: Generator[SQLResult], start: float) -> None:
793796 except ValueError as e :
794797 self .echo (f"Invalid watch sleep time provided ({ e } )." , err = True , fg = "red" )
795798 sys .exit (1 )
796- if is_select (status ) and cur and cur .rowcount > threshold :
799+ if is_select (status ) and isinstance ( cur , Cursor ) and cur .rowcount > threshold :
797800 self .echo (
798801 f"The result set has more than { threshold } rows." ,
799802 fg = "red" ,
@@ -843,7 +846,10 @@ def output_res(results: Generator[SQLResult], start: float) -> None:
843846 if self .show_warnings and isinstance (cur , Cursor ) and cur .warning_count > 0 :
844847 warnings = sqlexecute .run ("SHOW WARNINGS" )
845848 for warning in warnings :
846- title , cur , headers , status = warning .get_output ()
849+ title = warning .title
850+ cur = warning .results
851+ headers = warning .headers
852+ status = warning .status
847853 formatted = self .format_output (
848854 title ,
849855 cur ,
@@ -1307,7 +1313,9 @@ def run_query(self, query: str, new_line: bool = True) -> None:
13071313 assert self .sqlexecute is not None
13081314 results = self .sqlexecute .run (query )
13091315 for result in results :
1310- title , cur , headers , _status = result .get_output ()
1316+ title = result .title
1317+ cur = result .results
1318+ headers = result .headers
13111319 self .main_formatter .query = query
13121320 self .redirect_formatter .query = query
13131321 output = self .format_output (
@@ -1325,7 +1333,9 @@ def run_query(self, query: str, new_line: bool = True) -> None:
13251333 if self .show_warnings and isinstance (cur , Cursor ) and cur .warning_count > 0 :
13261334 warnings = self .sqlexecute .run ("SHOW WARNINGS" )
13271335 for warning in warnings :
1328- title , cur , headers , _status = warning .get_output ()
1336+ title = warning .title
1337+ cur = warning .results
1338+ headers = warning .headers
13291339 output = self .format_output (
13301340 title ,
13311341 cur ,
@@ -1341,7 +1351,7 @@ def format_output(
13411351 self ,
13421352 title : str | None ,
13431353 cur : Cursor | list [tuple ] | None ,
1344- headers : list [str ] | None ,
1354+ headers : list [str ] | str | None ,
13451355 expanded : bool = False ,
13461356 is_redirected : bool = False ,
13471357 null_string : str | None = None ,
0 commit comments