summary refs log tree commit diff
path: root/synapse/storage/database.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2023-11-09 11:13:31 -0500
committerGitHub <noreply@github.com>2023-11-09 11:13:31 -0500
commitab3f1b3b53cdb4e2751b3e8c5eb052d7475be58f (patch)
treed8f032a9833f5998626f67c9103768d6b77b4945 /synapse/storage/database.py
parentReturn attrs for more media repo APIs. (#16611) (diff)
downloadsynapse-ab3f1b3b53cdb4e2751b3e8c5eb052d7475be58f.tar.xz
Convert simple_select_one_txn and simple_select_one to return tuples. (#16612)
Diffstat (limited to 'synapse/storage/database.py')
-rw-r--r--synapse/storage/database.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py

index 0af0507307..eb34de4df5 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py
@@ -1597,7 +1597,7 @@ class DatabasePool: retcols: Collection[str], allow_none: Literal[False] = False, desc: str = "simple_select_one", - ) -> Dict[str, Any]: + ) -> Tuple[Any, ...]: ... @overload @@ -1608,7 +1608,7 @@ class DatabasePool: retcols: Collection[str], allow_none: Literal[True] = True, desc: str = "simple_select_one", - ) -> Optional[Dict[str, Any]]: + ) -> Optional[Tuple[Any, ...]]: ... async def simple_select_one( @@ -1618,7 +1618,7 @@ class DatabasePool: retcols: Collection[str], allow_none: bool = False, desc: str = "simple_select_one", - ) -> Optional[Dict[str, Any]]: + ) -> Optional[Tuple[Any, ...]]: """Executes a SELECT query on the named table, which is expected to return a single row, returning multiple columns from it. @@ -2127,7 +2127,7 @@ class DatabasePool: keyvalues: Dict[str, Any], retcols: Collection[str], allow_none: bool = False, - ) -> Optional[Dict[str, Any]]: + ) -> Optional[Tuple[Any, ...]]: select_sql = "SELECT %s FROM %s" % (", ".join(retcols), table) if keyvalues: @@ -2145,7 +2145,7 @@ class DatabasePool: if txn.rowcount > 1: raise StoreError(500, "More than one row matched (%s)" % (table,)) - return dict(zip(retcols, row)) + return row async def simple_delete_one( self, table: str, keyvalues: Dict[str, Any], desc: str = "simple_delete_one"