pystratum_pgsql.wrapper.PgSqlRowsWrapper   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 21
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A PgSqlRowsWrapper._write_result_handler() 0 7 1
1 1
from typing import Any, Dict
2
3 1
from pystratum_common.wrapper.RowsWrapper import RowsWrapper
4
5 1
from pystratum_pgsql.wrapper.PgSqlWrapper import PgSqlWrapper
6
7
8 1
class PgSqlRowsWrapper(PgSqlWrapper, RowsWrapper):
9
    """
10
    Wrapper method generator for stored procedures that are selecting 0, 1, or more rows.
11
    """
12
13
    # ------------------------------------------------------------------------------------------------------------------
14 1
    def _write_result_handler(self, routine: Dict[str, Any]) -> None:
15
        """
16
        Generates code of the return statement of the wrapper method for invoking a stored routine.
17
18
        :param dict routine: Metadata of the stored routine.
19
        """
20 1
        self._write_line('return self.execute_sp_rows({0!s})'.format(self._generate_command(routine)))
21
22
# ----------------------------------------------------------------------------------------------------------------------
23