Update stubs

This commit is contained in:
Trinh Anh Ngoc
2022-11-19 17:18:54 +07:00
parent a7c155fdd8
commit 9024078880

View File

@@ -1,104 +1,106 @@
from re import Pattern
from threading import Lock, RLock
from typing import Any, Callable, Iterable, Iterator, Literal, NoReturn, Sequence, TypeVar, Generator
import psycopg2.extensions
from typing import Any, Optional, TypeVar
_T = TypeVar('_T')
_CallableT = TypeVar('_CallableT', bound=Callable)
_CursorT = TypeVar('_CursorT', bound=Cursor)
_logger: Any
def unbuffer(symb, cr) -> str | None: ...
def undecimalize(symb, cr) -> float | None: ...
def adapt_string(adapted: str) -> psycopg2.extensions.QuotedString: ...
def flush_env(cr, *, clear: bool = ...) -> None: ...
def clear_env(cr) -> None: ...
def unbuffer(symb: Any, cr: Any): ...
def undecimalize(symb: Any, cr: Any): ...
def adapt_string(adapted: Any): ...
def flush_env(cr: Any, *, clear: bool = ...) -> None: ...
def clear_env(cr: Any) -> None: ...
re_from: Any
re_into: Any
re_from: Pattern
re_into: Pattern
sql_counter: int
class Cursor:
IN_MAX: int = ...
def check(f: Any): ...
sql_from_log: Any = ...
sql_into_log: Any = ...
sql_log: Any = ...
sql_log_count: int = ...
_closed: bool = ...
__pool: Any = ...
dbname: Any = ...
_serialized: Any = ...
_cnx: Any = ...
_obj: Any = ...
__caller: Any = ...
__closer: bool = ...
_default_log_exceptions: bool = ...
cache: Any = ...
_event_handlers: Any = ...
def __init__(self, pool: Any, dbname: Any, dsn: Any, serialized: bool = ...) -> None: ...
def __build_dict(self, row: Any): ...
def dictfetchone(self): ...
def dictfetchmany(self, size: Any): ...
def dictfetchall(self): ...
IN_MAX: int
def check(f: _CallableT) -> _CallableT: ...
sql_from_log: dict
sql_into_log: dict
sql_log: bool
sql_log_count: int
_closed: bool
__pool: ConnectionPool
dbname: str
_serialized: bool
_cnx: PsycoConnection
_obj: psycopg2.extensions.cursor
__caller: tuple[str, int | str] | Literal[False]
__closer: bool
_default_log_exceptions: bool
cache: dict
_event_handlers: dict[str, list[Callable]]
def __init__(self, pool: ConnectionPool, dbname: str, dsn: dict, serialized: bool = ...) -> None: ...
def __build_dict(self, row: Sequence) -> dict[str, Any]: ...
def dictfetchone(self) -> dict[str, Any] | None: ...
def dictfetchmany(self, size) -> list[dict[str, Any]]: ...
def dictfetchall(self) -> list[dict[str, Any]]: ...
def __del__(self) -> None: ...
def execute(self, query: Any, params: Optional[Any] = ..., log_exceptions: Optional[Any] = ...): ...
def split_for_in_conditions(self, ids: Any, size: Optional[Any] = ...): ...
def execute(self, query, params: Any | None = ..., log_exceptions: Any | None = ...): ...
def split_for_in_conditions(self, ids: Iterable, size: int | None = ...) -> Iterator[tuple]: ...
def print_log(self): ...
def close(self): ...
def _close(self, leak: bool = ...) -> None: ...
def autocommit(self, on: Any) -> None: ...
def after(self, event: Any, func: Any) -> None: ...
def _pop_event_handlers(self): ...
def autocommit(self, on: bool) -> None: ...
def after(self, event: str, func: Callable) -> None: ...
def _pop_event_handlers(self) -> dict[str, list[Callable]]: ...
def commit(self): ...
def rollback(self): ...
def __enter__(self: _T) -> _T: ...
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None: ...
def savepoint(self, flush: bool = ...) -> None: ...
def __getattr__(self, name: Any): ...
def __exit__(self, exc_type, exc_value, traceback) -> None: ...
def savepoint(self, flush: bool = ...) -> Generator[None, None, None]: ...
def __getattr__(self, name: str): ...
@property
def closed(self): ...
def closed(self) -> bool: ...
class TestCursor:
_savepoint_seq: Any = ...
_closed: bool = ...
_cursor: Any = ...
_lock: Any = ...
_savepoint: Any = ...
def __init__(self, cursor: Any, lock: Any) -> None: ...
_savepoint_seq: Iterator[int]
_closed: bool
_cursor: Cursor
_lock: RLock
_savepoint: str
def __init__(self, cursor: Cursor, lock: RLock) -> None: ...
def close(self) -> None: ...
def autocommit(self, on: Any) -> None: ...
def autocommit(self, on: bool) -> None: ...
def commit(self) -> None: ...
def rollback(self) -> None: ...
def __enter__(self): ...
def __exit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None: ...
def __getattr__(self, name: Any): ...
def __enter__(self: _T) -> _T: ...
def __exit__(self, exc_type, exc_value, traceback) -> None: ...
def __getattr__(self, name: str): ...
class PsycoConnection(psycopg2.extensions.connection): ...
class ConnectionPool:
def locked(fun: Any): ...
_connections: Any = ...
_maxconn: Any = ...
_lock: Any = ...
def locked(fun: Callable[..., _T]) -> Callable[..., _T]: ...
_connections: list[tuple[psycopg2.extensions.connection, bool]]
_maxconn: int
_lock: Lock
def __init__(self, maxconn: int = ...) -> None: ...
def __repr__(self): ...
def _debug(self, msg: Any, *args: Any) -> None: ...
def borrow(self, connection_info: Any): ...
def give_back(self, connection: Any, keep_in_pool: bool = ...) -> None: ...
def close_all(self, dsn: Optional[Any] = ...) -> None: ...
def __repr__(self) -> str: ...
def _debug(self, msg, *args) -> None: ...
def borrow(self, connection_info: dict) -> PsycoConnection: ...
def give_back(self, connection: PsycoConnection, keep_in_pool: bool = ...) -> None: ...
def close_all(self, dsn: dict | None = ...) -> None: ...
class Connection:
dbname: Any = ...
dsn: Any = ...
__pool: Any = ...
def __init__(self, pool: Any, dbname: Any, dsn: Any) -> None: ...
def cursor(self, serialized: bool = ...): ...
serialized_cursor: Any = ...
def __bool__(self) -> None: ...
__nonzero__: Any = ...
dbname: str
dsn: dict
__pool: ConnectionPool
def __init__(self, pool: ConnectionPool, dbname: str, dsn: dict) -> None: ...
def cursor(self, serialized: bool = ...) -> Cursor: ...
serialized_cursor = cursor
def __bool__(self) -> NoReturn: ...
def connection_info_for(db_or_uri: Any): ...
def connection_info_for(db_or_uri: str) -> tuple[str, dict]: ...
_Pool: Any
_Pool: ConnectionPool | None
def db_connect(to: Any, allow_uri: bool = ...): ...
def close_db(db_name: Any) -> None: ...
def db_connect(to: str, allow_uri: bool = ...) -> Connection: ...
def close_db(db_name: str) -> None: ...
def close_all() -> None: ...