summary refs log tree commit diff
path: root/synapse/storage/database.py
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-09-26 18:28:32 +0100
committerGitHub <noreply@github.com>2022-09-26 18:28:32 +0100
commit0a38c7ec6d46b6e51bfa53ff44e51637d3c63f5c (patch)
tree3509b9f8af1050186338a6f06f15e76f87562f89 /synapse/storage/database.py
parenttyping: check origin server of typing event against room's servers (#13830) (diff)
downloadsynapse-0a38c7ec6d46b6e51bfa53ff44e51637d3c63f5c.tar.xz
Snapshot schema 72 (#13873)
Including another batch of fixes to the schema dump script
Diffstat (limited to 'synapse/storage/database.py')
-rw-r--r--synapse/storage/database.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py
index 9d116f6925..6cc88aad32 100644
--- a/synapse/storage/database.py
+++ b/synapse/storage/database.py
@@ -393,6 +393,14 @@ class LoggingTransaction:
     def executemany(self, sql: str, *args: Any) -> None:
         self._do_execute(self.txn.executemany, sql, *args)
 
+    def executescript(self, sql: str) -> None:
+        if isinstance(self.database_engine, Sqlite3Engine):
+            self._do_execute(self.txn.executescript, sql)  # type: ignore[attr-defined]
+        else:
+            raise NotImplementedError(
+                f"executescript only exists for sqlite driver, not {type(self.database_engine)}"
+            )
+
     def _make_sql_one_line(self, sql: str) -> str:
         "Strip newlines out of SQL so that the loggers in the DB are on one line"
         return " ".join(line.strip() for line in sql.splitlines() if line.strip())