summary refs log tree commit diff
path: root/synapse/storage/database.py
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2023-10-30 14:34:37 +0000
committerGitHub <noreply@github.com>2023-10-30 14:34:37 +0000
commitfdce83ee60b3b5ffd0c41d112873a4de52b1e640 (patch)
treef25decfeeb127373476ec32798cea295b12506b2 /synapse/storage/database.py
parentBump setuptools-rust from 1.7.0 to 1.8.0 (#16574) (diff)
downloadsynapse-fdce83ee60b3b5ffd0c41d112873a4de52b1e640.tar.xz
Claim fallback keys in bulk (#16570)
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