Skip to content

Instantly share code, notes, and snippets.

@Stiivi
Created March 19, 2017 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Stiivi/41739c543de7841fc4ef09646f04d00f to your computer and use it in GitHub Desktop.
Save Stiivi/41739c543de7841fc4ef09646f04d00f to your computer and use it in GitHub Desktop.
interfaces.pyi
from typing import Any, Iterator, List, Mapping, Optional
# Note: The value type `Any` should be a DB API 2 value type once defined
# TODO: See #1037
class RowProxy(Mapping[str, Any]): ...
class ResultProxy(Iterator[RowProxy]):
def keys(self) -> List[str]: ...
def close(self) -> None: ...
def __iter__(self) -> Iterator[RowProxy]: ...
def fetchall(self) -> Iterator[RowProxy]: ...
def fetchmany(self, size: Optional[int]=None) -> Iterator[RowProxy]: ...
def fetchone(self) -> Optional[RowProxy]: ...
def first(self) -> Optional[RowProxy]: ...
# Note: The return type `Any` should be a DB API 2 value type once defined
# TODO: See #1037
def scalar(self): ...
@property
def rowcount(self) -> int: ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment