Skip to content

Commit

Permalink
approach with ClientSession manipulation
Browse files Browse the repository at this point in the history
  • Loading branch information
damian3031 committed Jan 5, 2023
1 parent 4020a0a commit 1daa3d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions trino/dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ def _prepare_statement(self, statement: str, name: str) -> None:
experimental_python_types=self._experimental_pyton_types)
query.execute()

# Approach with directly manipulating on ClientSession
# self._connection._client_session.prepared_statements[name] = statement

def _execute_prepared_statement(
self,
statement_name,
Expand Down Expand Up @@ -426,6 +429,9 @@ def _deallocate_prepared_statement(self, statement_name: str) -> None:
experimental_python_types=self._experimental_pyton_types)
query.execute()

# Approach with directly manipulating on ClientSession
# self._connection._client_session.prepared_statements.pop(statement_name, None)

def _generate_unique_statement_name(self):
return 'st_' + uuid.uuid4().hex.replace('-', '')

Expand Down

0 comments on commit 1daa3d4

Please sign in to comment.