diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-08-27 07:41:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 07:41:01 -0400 |
commit | 30426c7063a7e5567ac21cd10267651ef1935360 (patch) | |
tree | d18f000a9576bc52742301ed37793c6563914004 /synapse/storage/databases/main/__init__.py | |
parent | Convert simple_update* and simple_select* to async (#8173) (diff) | |
download | synapse-30426c7063a7e5567ac21cd10267651ef1935360.tar.xz |
Convert additional database methods to async (select list, search, insert_many, delete_*) (#8168)
Diffstat (limited to 'synapse/storage/databases/main/__init__.py')
-rw-r--r-- | synapse/storage/databases/main/__init__.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/storage/databases/main/__init__.py b/synapse/storage/databases/main/__init__.py index 8b9b6eb472..70cf15dd7f 100644 --- a/synapse/storage/databases/main/__init__.py +++ b/synapse/storage/databases/main/__init__.py @@ -18,7 +18,7 @@ import calendar import logging import time -from typing import Any, Dict, List +from typing import Any, Dict, List, Optional from synapse.api.constants import PresenceState from synapse.config.homeserver import HomeServerConfig @@ -559,17 +559,17 @@ class DataStore( "get_users_paginate_txn", get_users_paginate_txn ) - def search_users(self, term): + async def search_users(self, term: str) -> Optional[List[Dict[str, Any]]]: """Function to search users list for one or more users with the matched term. Args: - term (str): search term - col (str): column to query term should be matched to + term: search term + Returns: - defer.Deferred: resolves to list[dict[str, Any]] + A list of dictionaries or None. """ - return self.db_pool.simple_search_list( + return await self.db_pool.simple_search_list( table="users", term=term, col="name", |