massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / PyMySQL / pymysql / cursors.pyi
1 from typing import Any, Iterable, Iterator, Text, Tuple, TypeVar
2
3 from .connections import Connection
4
5 _SelfT = TypeVar("_SelfT")
6
7 class Cursor:
8     connection: Connection[Any]
9     description: Tuple[Text, ...]
10     rownumber: int
11     rowcount: int
12     arraysize: int
13     messages: Any
14     errorhandler: Any
15     lastrowid: int
16     def __init__(self, connection: Connection[Any]) -> None: ...
17     def __del__(self) -> None: ...
18     def close(self) -> None: ...
19     def setinputsizes(self, *args) -> None: ...
20     def setoutputsizes(self, *args) -> None: ...
21     def nextset(self) -> bool | None: ...
22     def mogrify(self, query: Text, args: object = ...) -> str: ...
23     def execute(self, query: Text, args: object = ...) -> int: ...
24     def executemany(self, query: Text, args: Iterable[object]) -> int | None: ...
25     def callproc(self, procname: Text, args: Iterable[Any] = ...) -> Any: ...
26     def scroll(self, value: int, mode: Text = ...) -> None: ...
27     def __enter__(self: _SelfT) -> _SelfT: ...
28     def __exit__(self, *exc_info: Any) -> None: ...
29     # Methods returning result tuples are below.
30     def fetchone(self) -> Tuple[Any, ...] | None: ...
31     def fetchmany(self, size: int | None = ...) -> Tuple[Tuple[Any, ...], ...]: ...
32     def fetchall(self) -> Tuple[Tuple[Any, ...], ...]: ...
33     def __iter__(self) -> Iterator[Tuple[Any, ...]]: ...
34
35 class DictCursorMixin:
36     dict_type: Any  # TODO: add support if someone needs this
37     def fetchone(self) -> dict[Text, Any] | None: ...
38     def fetchmany(self, size: int | None = ...) -> Tuple[dict[Text, Any], ...]: ...
39     def fetchall(self) -> Tuple[dict[Text, Any], ...]: ...
40     def __iter__(self) -> Iterator[dict[Text, Any]]: ...
41
42 class SSCursor(Cursor):
43     def fetchall(self) -> list[Tuple[Any, ...]]: ...  # type: ignore
44     def fetchall_unbuffered(self) -> Iterator[Tuple[Any, ...]]: ...
45     def scroll(self, value: int, mode: Text = ...) -> None: ...
46
47 class DictCursor(DictCursorMixin, Cursor): ...  # type: ignore
48
49 class SSDictCursor(DictCursorMixin, SSCursor):  # type: ignore
50     def fetchall_unbuffered(self) -> Iterator[dict[Text, Any]]: ...  # type: ignore