summary refs log tree commit diff
path: root/synapse/storage/database.py
diff options
context:
space:
mode:
authorPatrick Cloke <patrickc@matrix.org>2023-11-03 07:45:38 -0400
committerPatrick Cloke <patrickc@matrix.org>2023-11-03 07:45:38 -0400
commit671266b5a930674a26b25df8897957b05904dae9 (patch)
tree74bd22f6bc1cb09b3bbca7c461d39c1d1880105b /synapse/storage/database.py
parentMerge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff)
parentSimplify event persistence code (#16584) (diff)
downloadsynapse-671266b5a930674a26b25df8897957b05904dae9.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.py15
1 files changed, 0 insertions, 15 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py

index a4e7048368..6d54bb0eb2 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py
@@ -18,7 +18,6 @@ import logging import time import types from collections import defaultdict -from sys import intern from time import monotonic as monotonic_time from typing import ( TYPE_CHECKING, @@ -1042,20 +1041,6 @@ class DatabasePool: self._db_pool.runWithConnection(inner_func, *args, **kwargs) ) - @staticmethod - def cursor_to_dict(cursor: Cursor) -> List[Dict[str, Any]]: - """Converts a SQL cursor into an list of dicts. - - Args: - cursor: The DBAPI cursor which has executed a query. - Returns: - A list of dicts where the key is the column header. - """ - assert cursor.description is not None, "cursor.description was None" - col_headers = [intern(str(column[0])) for column in cursor.description] - results = [dict(zip(col_headers, row)) for row in cursor] - return results - async def execute(self, desc: str, query: str, *args: Any) -> List[Tuple[Any, ...]]: """Runs a single query for a result set.