diff options
author | Erik Johnston <erik@matrix.org> | 2020-09-02 17:52:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-02 17:52:38 +0100 |
commit | 112266eafd457204a34a76fa51d7074d0809a1db (patch) | |
tree | e860525baa50d8fc0cd5e5b5c2ce7d2a9727ee92 /synapse/storage/database.py | |
parent | Re-implement unread counts (again) (#8059) (diff) | |
download | synapse-112266eafd457204a34a76fa51d7074d0809a1db.tar.xz |
Add StreamStore to mypy (#8232)
Diffstat (limited to 'synapse/storage/database.py')
-rw-r--r-- | synapse/storage/database.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py index 7ab370efef..af8796ad92 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py @@ -604,6 +604,18 @@ class DatabasePool(object): results = [dict(zip(col_headers, row)) for row in cursor] return results + @overload + async def execute( + self, desc: str, decoder: Literal[None], query: str, *args: Any + ) -> List[Tuple[Any, ...]]: + ... + + @overload + async def execute( + self, desc: str, decoder: Callable[[Cursor], R], query: str, *args: Any + ) -> R: + ... + async def execute( self, desc: str, @@ -1088,6 +1100,28 @@ class DatabasePool(object): desc, self.simple_select_one_txn, table, keyvalues, retcols, allow_none ) + @overload + async def simple_select_one_onecol( + self, + table: str, + keyvalues: Dict[str, Any], + retcol: Iterable[str], + allow_none: Literal[False] = False, + desc: str = "simple_select_one_onecol", + ) -> Any: + ... + + @overload + async def simple_select_one_onecol( + self, + table: str, + keyvalues: Dict[str, Any], + retcol: Iterable[str], + allow_none: Literal[True] = True, + desc: str = "simple_select_one_onecol", + ) -> Optional[Any]: + ... + async def simple_select_one_onecol( self, table: str, |