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

Log values at DEBUG level with execute_values #16281

Merged
merged 2 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading