Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add an overload for simple_select_one_onecol_txn. #8235

Merged
merged 1 commit into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8235.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add type hints to `StreamStore`.
24 changes: 24 additions & 0 deletions synapse/storage/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,30 @@ async def simple_select_one_onecol(
allow_none=allow_none,
)

@overload
@classmethod
def simple_select_one_onecol_txn(
cls,
txn: LoggingTransaction,
table: str,
keyvalues: Dict[str, Any],
retcol: Iterable[str],
allow_none: Literal[False] = False,
) -> Any:
...

@overload
@classmethod
def simple_select_one_onecol_txn(
cls,
txn: LoggingTransaction,
table: str,
keyvalues: Dict[str, Any],
retcol: Iterable[str],
allow_none: Literal[True] = True,
) -> Optional[Any]:
...

@classmethod
def simple_select_one_onecol_txn(
cls,
Expand Down