mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 16:13:50 +01:00
Log values at DEBUG level with execute_values (#16281)
This commit is contained in:
parent
5c8870cb28
commit
c1c6c95d72
2 changed files with 4 additions and 2 deletions
1
changelog.d/16281.misc
Normal file
1
changelog.d/16281.misc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Include values in SQL debug when using `execute_values` with Postgres.
|
|
@ -422,10 +422,11 @@ class LoggingTransaction:
|
||||||
return self._do_execute(
|
return self._do_execute(
|
||||||
# TODO: is it safe for values to be Iterable[Iterable[Any]] here?
|
# 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]
|
# 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(
|
lambda the_sql, the_values: execute_values(
|
||||||
self.txn, the_sql, values, template=template, fetch=fetch
|
self.txn, the_sql, the_values, template=template, fetch=fetch
|
||||||
),
|
),
|
||||||
sql,
|
sql,
|
||||||
|
values,
|
||||||
)
|
)
|
||||||
|
|
||||||
def execute(self, sql: str, parameters: SQLQueryParameters = ()) -> None:
|
def execute(self, sql: str, parameters: SQLQueryParameters = ()) -> None:
|
||||||
|
|
Loading…
Reference in a new issue