def METHOD_NAME(func):
    @functools.wraps(func)
    def wrapper(self, sql, *args, **kwargs):
        # For cases when SQL queries are written to StringIO
        value_getter = getattr(sql, 'getvalue', None)
        debug_output = sql if not value_getter else value_getter()
        logger.debug(debug_output[:1000])
        with transaction_context() as conn:
            with conn.cursor() as curs:
                self._curs = curs  # pylint: disable=protected-access
                return func(self, sql, *args, **kwargs)
    return wrapper