mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 13:24:52 -04:00
Snapshot schema 72 (#13873)
Including another batch of fixes to the schema dump script
This commit is contained in:
parent
41461fd4d6
commit
0a38c7ec6d
13 changed files with 2165 additions and 22 deletions
|
@ -31,7 +31,9 @@ if TYPE_CHECKING:
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PostgresEngine(BaseDatabaseEngine[psycopg2.extensions.connection]):
|
||||
class PostgresEngine(
|
||||
BaseDatabaseEngine[psycopg2.extensions.connection, psycopg2.extensions.cursor]
|
||||
):
|
||||
def __init__(self, database_config: Mapping[str, Any]):
|
||||
super().__init__(psycopg2, database_config)
|
||||
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
|
||||
|
@ -212,3 +214,11 @@ class PostgresEngine(BaseDatabaseEngine[psycopg2.extensions.connection]):
|
|||
else:
|
||||
isolation_level = self.isolation_level_map[isolation_level]
|
||||
return conn.set_isolation_level(isolation_level)
|
||||
|
||||
@staticmethod
|
||||
def executescript(cursor: psycopg2.extensions.cursor, script: str) -> None:
|
||||
"""Execute a chunk of SQL containing multiple semicolon-delimited statements.
|
||||
|
||||
Psycopg2 seems happy to do this in DBAPI2's `execute()` function.
|
||||
"""
|
||||
cursor.execute(script)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue