Source code for pystratum_pgsql.wrapper.PgSqlRowsWrapper

from typing import Any, Dict

from pystratum_common.wrapper.RowsWrapper import RowsWrapper

from pystratum_pgsql.wrapper.PgSqlWrapper import PgSqlWrapper


[docs]class PgSqlRowsWrapper(PgSqlWrapper, RowsWrapper): """ Wrapper method generator for stored procedures that are selecting 0, 1, or more rows. """ # ------------------------------------------------------------------------------------------------------------------ def _write_result_handler(self, routine: Dict[str, Any]) -> None: """ Generates code of the return statement of the wrapper method for invoking a stored routine. :param dict routine: Metadata of the stored routine. """ self._write_line('return self.execute_sp_rows({0!s})'.format(self._generate_command(routine)))
# ----------------------------------------------------------------------------------------------------------------------