Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Log values at DEBUG level with execute_values (#16281)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson authored Sep 8, 2023
1 parent 5c8870c commit c1c6c95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.d/16281.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Include values in SQL debug when using `execute_values` with Postgres.
5 changes: 3 additions & 2 deletions synapse/storage/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,11 @@ def execute_values(
return self._do_execute(
# TODO: is it safe for values to be Iterable[Iterable[Any]] here?
# https://www.psycopg.org/docs/extras.html?highlight=execute_batch#psycopg2.extras.execute_values says values should be Sequence[Sequence]
lambda the_sql: execute_values(
self.txn, the_sql, values, template=template, fetch=fetch
lambda the_sql, the_values: execute_values(
self.txn, the_sql, the_values, template=template, fetch=fetch
),
sql,
values,
)

def execute(self, sql: str, parameters: SQLQueryParameters = ()) -> None:
Expand Down

0 comments on commit c1c6c95

Please sign in to comment.