summary refs log tree commit diff
path: root/synapse/storage/database.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2023-10-30 14:48:17 +0000
committerErik Johnston <erik@matrix.org>2023-10-30 14:48:17 +0000
commitaa00ab19ce986dbddb246222ce20e0a61e7a9f36 (patch)
tree1dce365ddda5c5fccbd5122319ba5b40dda872dd /synapse/storage/database.py
parentMerge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff)
parentAdd fast path for replication events stream fetch (#16580) (diff)
downloadsynapse-aa00ab19ce986dbddb246222ce20e0a61e7a9f36.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/storage/database.py')
-rw-r--r--synapse/storage/database.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py

index b1ece63845..a4e7048368 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py
@@ -420,6 +420,16 @@ class LoggingTransaction: self._do_execute(self.txn.execute, sql, parameters) def executemany(self, sql: str, *args: Any) -> None: + """Repeatedly execute the same piece of SQL with different parameters. + + See https://peps.python.org/pep-0249/#executemany. Note in particular that + + > Use of this method for an operation which produces one or more result sets + > constitutes undefined behavior + + so you can't use this for e.g. a SELECT, an UPDATE ... RETURNING, or a + DELETE FROM... RETURNING. + """ # TODO: we should add a type for *args here. Looking at Cursor.executemany # and DBAPI2 it ought to be Sequence[_Parameter], but we pass in # Iterable[Iterable[Any]] in execute_batch and execute_values above, which mypy