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-10-10 12:16:36 -0400
committerGitHub <noreply@github.com>2023-10-10 12:16:36 -0400
commitf1e43018b7d526f3e969796bf882c1848b663449 (patch)
treea2a33ea2910094f5dc88eef6f7efea1214ce573e /synapse/storage/database.py
parentMerge remote-tracking branch 'origin/master' into develop (diff)
downloadsynapse-f1e43018b7d526f3e969796bf882c1848b663449.tar.xz
Inline simple_search_list/simple_search_list_txn. (#16434)
This only has a single use and is over abstracted. Inline it so that
we can improve type hints.
Diffstat (limited to 'synapse/storage/database.py')
-rw-r--r--synapse/storage/database.py62
1 files changed, 0 insertions, 62 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py
index 7d8af5c610..7714ec2bf9 100644
--- a/synapse/storage/database.py
+++ b/synapse/storage/database.py
@@ -2476,68 +2476,6 @@ class DatabasePool:
 
         return txn.fetchall()
 
-    async def simple_search_list(
-        self,
-        table: str,
-        term: Optional[str],
-        col: str,
-        retcols: Collection[str],
-        desc: str = "simple_search_list",
-    ) -> Optional[List[Dict[str, Any]]]:
-        """Executes a SELECT query on the named table, which may return zero or
-        more rows, returning the result as a list of dicts.
-
-        Args:
-            table: the table name
-            term: term for searching the table matched to a column.
-            col: column to query term should be matched to
-            retcols: the names of the columns to return
-
-        Returns:
-            A list of dictionaries or None.
-        """
-
-        return await self.runInteraction(
-            desc,
-            self.simple_search_list_txn,
-            table,
-            term,
-            col,
-            retcols,
-            db_autocommit=True,
-        )
-
-    @classmethod
-    def simple_search_list_txn(
-        cls,
-        txn: LoggingTransaction,
-        table: str,
-        term: Optional[str],
-        col: str,
-        retcols: Iterable[str],
-    ) -> Optional[List[Dict[str, Any]]]:
-        """Executes a SELECT query on the named table, which may return zero or
-        more rows, returning the result as a list of dicts.
-
-        Args:
-            txn: Transaction object
-            table: the table name
-            term: term for searching the table matched to a column.
-            col: column to query term should be matched to
-            retcols: the names of the columns to return
-
-        Returns:
-            None if no term is given, otherwise a list of dictionaries.
-        """
-        if term:
-            sql = "SELECT %s FROM %s WHERE %s LIKE ?" % (", ".join(retcols), table, col)
-            termvalues = ["%%" + term + "%%"]
-            txn.execute(sql, termvalues)
-        else:
-            return None
-
-        return cls.cursor_to_dict(txn)
-
 
 def make_in_list_sql_clause(
     database_engine: BaseDatabaseEngine, column: str, iterable: Collection[Any]