in pyqldb/transaction/transaction.py [0:0]
def _execute_statement(self, statement, *parameters):
"""
Execute the statement.
:type statement: str/function
:param statement: The statement to execute.
:type parameters: Variable length argument list
:param parameters: Ion values or Python native types that are convertible to Ion for filling in parameters
of the statement.
`Details on conversion support and rules <https://ion-python.readthedocs.io/en/latest/amazon.ion.html?highlight=simpleion#module-amazon.ion.simpleion>`_.
:rtype: :py:class:`pyqldb.cursor.stream_cursor`/object
:return: Cursor on the result set of the statement.
:raises ClientError: When there is an error executing against QLDB.
:raises TypeError: When conversion of native data type (in parameters) to Ion fails due to an unsupported type.
"""
parameters = tuple(map(self._to_ion, parameters))
self._update_hash(statement, parameters)
statement_result = self._session._execute_statement(self._id, statement, parameters)
if self._read_ahead > 0:
cursor = ReadAheadCursor(statement_result, self._session, self._id, self._read_ahead, self._executor)
else:
cursor = StreamCursor(statement_result, self._session, self._id)
self._cursors.append(cursor)
return cursor