Completed
Push — master ( de86bb...677151 )
by P.R.
01:20
created

PgSqlTableWrapper._write_result_handler()   A

Complexity

Conditions 1

Size

Total Lines 7
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 2
dl 0
loc 7
ccs 1
cts 2
cp 0.5
crap 1.125
rs 10
c 0
b 0
f 0
1 1
from typing import Any, Dict
2
3 1
from pystratum_common.wrapper.TableWrapper import TableWrapper
4
5 1
from pystratum_pgsql.wrapper.PgSqlWrapper import PgSqlWrapper
6
7
8 1
class PgSqlTableWrapper(PgSqlWrapper, TableWrapper):
9
    """
10
    Wrapper method generator for printing the result set of stored procedures in a table format.
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
        self._write_line('return self.execute_sp_table({0!s})'.format(self._generate_command(routine)))
21
22
# ----------------------------------------------------------------------------------------------------------------------
23