| Total Complexity | 2 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 85.71% |
| Changes | 0 | ||
| 1 | 1 | from typing import Any, Dict |
|
| 2 | |||
| 3 | 1 | from pystratum_common.wrapper.RowsWrapper import RowsWrapper |
|
| 4 | 1 | ||
| 5 | from pystratum_mysql.wrapper.MySqlWrapper import MySqlWrapper |
||
| 6 | |||
| 7 | 1 | ||
| 8 | class MySqlRowsWrapper(MySqlWrapper, RowsWrapper): |
||
| 9 | """ |
||
| 10 | Wrapper method generator for stored procedures that are selecting 0, 1, or more rows. |
||
| 11 | """ |
||
| 12 | |||
| 13 | 1 | # ------------------------------------------------------------------------------------------------------------------ |
|
| 14 | def _return_type_hint(self) -> str: |
||
| 15 | """ |
||
| 16 | Returns the return type hint of the wrapper method. |
||
| 17 | """ |
||
| 18 | return 'List[Dict[str, Any]]' |
||
| 19 | |||
| 20 | # ------------------------------------------------------------------------------------------------------------------ |
||
| 21 | def _write_result_handler(self, routine: Dict[str, Any]) -> None: |
||
| 22 | 1 | """ |
|
| 23 | Generates code for calling the stored routine in the wrapper method. |
||
| 24 | """ |
||
| 25 | self._write_line('return self.execute_sp_rows({0!s})'.format(self._generate_command(routine))) |
||
| 26 | |||
| 28 |