Snapshot schema 72 (#13873)

Including another batch of fixes to the schema dump script
This commit is contained in:
David Robertson 2022-09-26 18:28:32 +01:00 committed by GitHub
parent 41461fd4d6
commit 0a38c7ec6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 2165 additions and 22 deletions

View file

@ -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())