mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Enable pyright strict mode (#2652)
- added pyrightconfig.json with typeCheckingMode=strict - added type hints to all files except api.py - added type stubs for dns, etcd, consul, kazoo, pysyncobj and other modules - added type stubs for psycopg2 and urllib3 with some little fixes - fixes most of the issues reported by pyright - remaining issues will be addressed later, along with enabling CI linting task
This commit is contained in:
@@ -0,0 +1 @@
|
||||
class ClientError(Exception): ...
|
||||
@@ -0,0 +1,11 @@
|
||||
from typing import Any, Callable, Dict, Optional
|
||||
DEFAULT_METADATA_SERVICE_TIMEOUT = 1
|
||||
METADATA_BASE_URL = 'http://169.254.169.254/'
|
||||
class AWSResponse:
|
||||
status_code: int
|
||||
@property
|
||||
def text(self) -> str: ...
|
||||
class IMDSFetcher:
|
||||
def __init__(self, timeout: float = DEFAULT_METADATA_SERVICE_TIMEOUT, num_attempts: int = 1, base_url: str = METADATA_BASE_URL, env: Optional[Dict[str, str]] = None, user_agent: Optional[str] = None, config: Optional[Dict[str, Any]] = None) -> None: ...
|
||||
def _fetch_metadata_token(self) -> Optional[str]: ...:
|
||||
def _get_request(self, url_path: str, retry_func: Optional[Callable[[AWSResponse], bool]] = None, token: Optional[str] = None) -> AWSResponse: ...
|
||||
@@ -0,0 +1,5 @@
|
||||
import io
|
||||
from typing import Any
|
||||
class PatchStream:
|
||||
def __init__(self, diff_hdl: io.TextIOBase) -> None: ...
|
||||
def markup_to_pager(stream: Any, opts: Any) -> None: ...
|
||||
@@ -0,0 +1,2 @@
|
||||
from consul.base import ConsulException, NotFound
|
||||
__all__ = ['ConsulException', 'Consul', 'NotFound']
|
||||
@@ -0,0 +1,24 @@
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
class ConsulException(Exception): ...
|
||||
class NotFound(ConsulException): ...
|
||||
class Check:
|
||||
@classmethod
|
||||
def http(klass, url: str, interval: str, timeout: Optional[str] = None, deregister: Optional[str] = None) -> Dict[str, str]: ...
|
||||
class Consul:
|
||||
http: Any
|
||||
agent: 'Consul.Agent'
|
||||
session: 'Consul.Session'
|
||||
kv: 'Consul.KV'
|
||||
class KV:
|
||||
def get(self, key: str, index: Optional[int]=None, recurse: bool = False, wait: Optional[str] = None, token: Optional[str] = None, consistency: Optional[str] = None, keys: bool = False, separator: Optional[str] = '', dc: Optional[str] = None) -> Tuple[int, Dict[str, Any]]: ...
|
||||
def put(self, key: str, value: str, cas: Optional[int] = None, flags: Optional[int] = None, acquire: Optional[str] = None, release: Optional[str] = None, token: Optional[str] = None, dc: Optional[str] = None) -> bool: ...
|
||||
def delete(self, key: str, recurse: Optional[bool] = None, cas: Optional[int] = None, token: Optional[str] = None, dc: Optional[str] = None) -> bool: ...
|
||||
class Agent:
|
||||
service: 'Consul.Agent.Service'
|
||||
def self(self) -> Dict[str, Dict[str, Any]]: ...
|
||||
class Service:
|
||||
def register(self, name: str, service_id=..., address=..., port=..., tags=..., check=..., token=..., script=..., interval=..., ttl=..., http=..., timeout=..., enable_tag_override=...) -> bool: ...
|
||||
def deregister(self, service_id: str) -> bool: ...
|
||||
class Session:
|
||||
def create(self, name: Optional[str] = None, node: Optional[str] = [], checks: Optional[List[str]]=None, lock_delay: float = 15, behavior: str = 'release', ttl: Optional[int] = None, dc: Optional[str] = None) -> str: ...
|
||||
def renew(self, session_id: str, dc: Optional[str] = None) -> Optional[str]: ...
|
||||
@@ -0,0 +1,17 @@
|
||||
from typing import Union, Optional, Iterator
|
||||
class Name:
|
||||
def to_text(self, omit_final_dot: bool = ...) -> str: ...
|
||||
class Rdata:
|
||||
target: Name = ...
|
||||
port: int = ...
|
||||
class Answer:
|
||||
def __iter__(self) -> Iterator[Rdata]: ...
|
||||
def resolve(qname : str, rdtype : Union[int,str] = 0,
|
||||
rdclass : Union[int,str] = 0,
|
||||
tcp=False, source=None, raise_on_no_answer=True,
|
||||
source_port=0, lifetime : Optional[float]=None,
|
||||
search : Optional[bool]=None) -> Answer: ...
|
||||
def query(qname : str, rdtype : Union[int,str] = 0,
|
||||
rdclass : Union[int,str] = 0,
|
||||
tcp=False, source: Optional[str] = None, raise_on_no_answer=True,
|
||||
source_port=0, lifetime : Optional[float]=None) -> Answer: ...
|
||||
@@ -0,0 +1,24 @@
|
||||
from typing import Dict, Optional, Type, List
|
||||
from .client import Client
|
||||
__all__ = ['Client', 'EtcdError', 'EtcdException', 'EtcdEventIndexCleared', 'EtcdWatcherCleared', 'EtcdKeyNotFound', 'EtcdAlreadyExist', 'EtcdResult', 'EtcdConnectionFailed', 'EtcdWatchTimedOut']
|
||||
class EtcdResult:
|
||||
action: str = ...
|
||||
modifiedIndex: int = ...
|
||||
key: str = ...
|
||||
value: str = ...
|
||||
ttl: Optional[float] = ...
|
||||
@property
|
||||
def leaves(self) -> List['EtcdResult']: ...
|
||||
class EtcdException(Exception):
|
||||
def __init__(self, message=..., payload=...) -> None: ...
|
||||
class EtcdConnectionFailed(EtcdException):
|
||||
def __init__(self, message=..., payload=..., cause=...) -> None: ...
|
||||
class EtcdKeyError(EtcdException): ...
|
||||
class EtcdKeyNotFound(EtcdKeyError): ...
|
||||
class EtcdAlreadyExist(EtcdKeyError): ...
|
||||
class EtcdEventIndexCleared(EtcdException): ...
|
||||
class EtcdWatchTimedOut(EtcdConnectionFailed): ...
|
||||
class EtcdWatcherCleared(EtcdException): ...
|
||||
class EtcdLeaderElectionInProgress(EtcdException): ...
|
||||
class EtcdError:
|
||||
error_exceptions: Dict[int, Type[EtcdException]] = ...
|
||||
@@ -0,0 +1,29 @@
|
||||
import urllib3
|
||||
from typing import Any, Optional, Set
|
||||
from . import EtcdResult
|
||||
class Client:
|
||||
_MGET: str
|
||||
_MPUT: str
|
||||
_MPOST: str
|
||||
_MDELETE: str
|
||||
_comparison_conditions: Set[str]
|
||||
_read_options: Set[str]
|
||||
_del_conditions: Set[str]
|
||||
http: urllib3.poolmanager.PoolManager
|
||||
_use_proxies: bool
|
||||
version_prefix: str
|
||||
username: Optional[str]
|
||||
password: Optional[str]
|
||||
def __init__(self, host=..., port=..., srv_domain=..., version_prefix=..., read_timeout=..., allow_redirect=..., protocol=..., cert=..., ca_cert=..., username=..., password=..., allow_reconnect=..., use_proxies=..., expected_cluster_id=..., per_host_pool_size=..., lock_prefix=...): ...
|
||||
@property
|
||||
def protocol(self) -> str: ...
|
||||
@property
|
||||
def read_timeout(self) -> int: ...
|
||||
@property
|
||||
def allow_redirect(self) -> bool: ...
|
||||
def write(self, key: str, value: str, ttl: int = ..., dir: bool = ..., append: bool = ..., **kwdargs: Any) -> EtcdResult: ...
|
||||
def read(self, key: str, **kwdargs: Any) -> EtcdResult: ...
|
||||
def delete(self, key: str, recursive: bool = ..., dir: bool = ..., **kwdargs: Any) -> EtcdResult: ...
|
||||
def set(self, key: str, value: str, ttl: int = ...) -> EtcdResult: ...
|
||||
def watch(self, key: str, index: int = ..., timeout: float = ..., recursive: bool = ...) -> EtcdResult: ...
|
||||
def _handle_server_response(self, response: urllib3.response.HTTPResponse) -> Any: ...
|
||||
@@ -0,0 +1,34 @@
|
||||
__all__ = ['KazooState', 'KazooClient', 'KazooRetry']
|
||||
|
||||
from kazoo.protocol.connection import ConnectionHandler
|
||||
from kazoo.protocol.states import KazooState, WatchedEvent, ZnodeStat
|
||||
from kazoo.handlers.threading import AsyncResult, SequentialThreadingHandler
|
||||
from kazoo.retry import KazooRetry
|
||||
from kazoo.security import ACL
|
||||
|
||||
from typing import Any, Callable, Optional, Tuple, List
|
||||
|
||||
|
||||
class KazooClient:
|
||||
handler: SequentialThreadingHandler
|
||||
_state: str
|
||||
_connection: ConnectionHandler
|
||||
_session_timeout: int
|
||||
retry: Callable[..., Any]
|
||||
_retry: KazooRetry
|
||||
def __init__(self, hosts=..., timeout=..., client_id=..., handler=..., default_acl=..., auth_data=..., sasl_options=..., read_only=..., randomize_hosts=..., connection_retry=..., command_retry=..., logger=..., keyfile=..., keyfile_password=..., certfile=..., ca=..., use_ssl=..., verify_certs=..., **kwargs) -> None: ...
|
||||
@property
|
||||
def client_id(self) -> Optional[Tuple[Any]]: ...
|
||||
def add_listener(self, listener: Callable[[str], None]) -> None: ...
|
||||
def start(self, timeout: int = ...) -> None: ...
|
||||
def restart(self) -> None: ...
|
||||
def set_hosts(self, hosts: str, randomize_hosts: Optional[bool] = None) -> None: ...
|
||||
def create(self, path: str, value: bytes = b'', acl: Optional[ACL]=None, ephemeral: bool = False, sequence: bool = False, makepath: bool = False, include_data: bool = False) -> None: ...
|
||||
def create_async(self, path: str, value: bytes = b'', acl: Optional[ACL]=None, ephemeral: bool = False, sequence: bool = False, makepath: bool = False, include_data: bool = False) -> AsyncResult: ...
|
||||
def get(self, path: str, watch: Optional[Callable[[WatchedEvent], None]] = None) -> Tuple[bytes, ZnodeStat]: ...
|
||||
def get_children(self, path: str, watch: Optional[Callable[[WatchedEvent], None]] = None, include_data: bool = False) -> List[str]: ...
|
||||
def set(self, path: str, value: bytes, version: int = -1) -> ZnodeStat: ...
|
||||
def set_async(self, path: str, value: bytes, version: int = -1) -> AsyncResult: ...
|
||||
def delete(self, path: str, version: int = -1, recursive: bool = False) -> None: ...
|
||||
def delete_async(self, path: str, version: int = -1) -> AsyncResult: ...
|
||||
def _call(self, request: Tuple[Any], async_object: AsyncResult) -> Optional[bool]: ...
|
||||
@@ -0,0 +1,12 @@
|
||||
class KazooException(Exception):
|
||||
...
|
||||
class ZookeeperError(KazooException):
|
||||
...
|
||||
class SessionExpiredError(ZookeeperError):
|
||||
...
|
||||
class ConnectionClosedError(SessionExpiredError):
|
||||
...
|
||||
class NoNodeError(ZookeeperError):
|
||||
...
|
||||
class NodeExistsError(ZookeeperError):
|
||||
...
|
||||
@@ -0,0 +1,13 @@
|
||||
import socket
|
||||
from kazoo.handlers import utils
|
||||
from typing import Any
|
||||
|
||||
class AsyncResult(utils.AsyncResult):
|
||||
...
|
||||
|
||||
class SequentialThreadingHandler:
|
||||
def select(self, *args: Any, **kwargs: Any) -> Any:
|
||||
...
|
||||
|
||||
def create_connection(self, *args: Any, **kwargs: Any) -> socket.socket:
|
||||
...
|
||||
@@ -0,0 +1,6 @@
|
||||
from typing import Any, Optional
|
||||
class AsyncResult:
|
||||
def set_exception(self, exception: Exception) -> None:
|
||||
...
|
||||
def get(self, block: bool = False, timeout: Optional[float] = None) -> Any:
|
||||
...
|
||||
@@ -0,0 +1,6 @@
|
||||
import socket
|
||||
from typing import Any, Union, Tuple
|
||||
class ConnectionHandler:
|
||||
_socket: socket.socket
|
||||
def _connect(self, *args: Any) -> Tuple[Union[int, float], Union[int, float]]:
|
||||
...
|
||||
@@ -0,0 +1,29 @@
|
||||
from typing import Any, NamedTuple
|
||||
class KazooState:
|
||||
SUSPENDED: str
|
||||
CONNECTED: str
|
||||
LOST: str
|
||||
class KeeperState:
|
||||
AUTH_FAILED: str
|
||||
CONNECTED: str
|
||||
CONNECTED_RO: str
|
||||
CONNECTING: str
|
||||
CLOSED: str
|
||||
EXPIRED_SESSION: str
|
||||
class WatchedEvent(NamedTuple):
|
||||
type: str
|
||||
state: str
|
||||
path: str
|
||||
class ZnodeStat(NamedTuple):
|
||||
|
||||
czxid: int
|
||||
mzxid: int
|
||||
ctime: float
|
||||
mtime: float
|
||||
version: int
|
||||
cversion: int
|
||||
aversion: int
|
||||
ephemeralOwner: Any
|
||||
dataLength: int
|
||||
numChildren: int
|
||||
pzxid: int
|
||||
@@ -0,0 +1,7 @@
|
||||
from kazoo.exceptions import KazooException
|
||||
class RetryFailedError(KazooException):
|
||||
...
|
||||
class KazooRetry:
|
||||
deadline: float
|
||||
def __init__(self, max_tries=..., delay=..., backoff=..., max_jitter=..., max_delay=..., ignore_expire=..., sleep_func=..., deadline=..., interrupt=...) -> None:
|
||||
...
|
||||
@@ -0,0 +1,5 @@
|
||||
from collections import namedtuple
|
||||
class ACL(namedtuple('ACL', 'perms id')):
|
||||
...
|
||||
def make_acl(scheme: str, credential: str, read: bool = ..., write: bool = ..., create: bool = ..., delete: bool = ..., admin: bool = ..., all: bool = ...) -> ACL:
|
||||
...
|
||||
@@ -0,0 +1,13 @@
|
||||
from typing import Any, Dict, List
|
||||
FRAME = 1
|
||||
ALL = 1
|
||||
class PrettyTable:
|
||||
def __init__(self, *args: str, **kwargs: Any) -> None: ...
|
||||
def _stringify_hrule(self, options: Dict[str, Any], where: str = '') -> str: ...
|
||||
@property
|
||||
def align(self) -> Dict[str, str]: ...
|
||||
@align.setter
|
||||
def align(self, val: str) -> None: ...
|
||||
def add_row(self, row: List[Any]) -> None: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __repr__(self) -> str: ...
|
||||
@@ -0,0 +1,52 @@
|
||||
from collections.abc import Callable
|
||||
from typing import Any, TypeVar, overload
|
||||
|
||||
# connection and cursor not available at runtime
|
||||
from psycopg2._psycopg import (
|
||||
BINARY as BINARY,
|
||||
DATETIME as DATETIME,
|
||||
NUMBER as NUMBER,
|
||||
ROWID as ROWID,
|
||||
STRING as STRING,
|
||||
Binary as Binary,
|
||||
DatabaseError as DatabaseError,
|
||||
DataError as DataError,
|
||||
Date as Date,
|
||||
DateFromTicks as DateFromTicks,
|
||||
Error as Error,
|
||||
IntegrityError as IntegrityError,
|
||||
InterfaceError as InterfaceError,
|
||||
InternalError as InternalError,
|
||||
NotSupportedError as NotSupportedError,
|
||||
OperationalError as OperationalError,
|
||||
ProgrammingError as ProgrammingError,
|
||||
Time as Time,
|
||||
TimeFromTicks as TimeFromTicks,
|
||||
Timestamp as Timestamp,
|
||||
TimestampFromTicks as TimestampFromTicks,
|
||||
Warning as Warning,
|
||||
__libpq_version__ as __libpq_version__,
|
||||
apilevel as apilevel,
|
||||
connection as connection,
|
||||
cursor as cursor,
|
||||
paramstyle as paramstyle,
|
||||
threadsafety as threadsafety,
|
||||
)
|
||||
|
||||
__version__: str
|
||||
|
||||
_T_conn = TypeVar("_T_conn", bound=connection)
|
||||
|
||||
@overload
|
||||
def connect(dsn: str, connection_factory: Callable[..., _T_conn], cursor_factory: None = None, **kwargs: Any) -> _T_conn: ...
|
||||
@overload
|
||||
def connect(
|
||||
dsn: str | None = None, *, connection_factory: Callable[..., _T_conn], cursor_factory: None = None, **kwargs: Any
|
||||
) -> _T_conn: ...
|
||||
@overload
|
||||
def connect(
|
||||
dsn: str | None = None,
|
||||
connection_factory: Callable[..., connection] | None = None,
|
||||
cursor_factory: Callable[..., cursor] | None = None,
|
||||
**kwargs: Any,
|
||||
) -> connection: ...
|
||||
@@ -0,0 +1,9 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import Any
|
||||
|
||||
ipaddress: Any
|
||||
|
||||
def register_ipaddress(conn_or_curs: Incomplete | None = None) -> None: ...
|
||||
def cast_interface(s, cur: Incomplete | None = None): ...
|
||||
def cast_network(s, cur: Incomplete | None = None): ...
|
||||
def adapt_ipaddress(obj): ...
|
||||
@@ -0,0 +1,26 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import Any
|
||||
|
||||
JSON_OID: int
|
||||
JSONARRAY_OID: int
|
||||
JSONB_OID: int
|
||||
JSONBARRAY_OID: int
|
||||
|
||||
class Json:
|
||||
adapted: Any
|
||||
def __init__(self, adapted, dumps: Incomplete | None = None) -> None: ...
|
||||
def __conform__(self, proto): ...
|
||||
def dumps(self, obj): ...
|
||||
def prepare(self, conn) -> None: ...
|
||||
def getquoted(self): ...
|
||||
|
||||
def register_json(
|
||||
conn_or_curs: Incomplete | None = None,
|
||||
globally: bool = False,
|
||||
loads: Incomplete | None = None,
|
||||
oid: Incomplete | None = None,
|
||||
array_oid: Incomplete | None = None,
|
||||
name: str = "json",
|
||||
): ...
|
||||
def register_default_json(conn_or_curs: Incomplete | None = None, globally: bool = False, loads: Incomplete | None = None): ...
|
||||
def register_default_jsonb(conn_or_curs: Incomplete | None = None, globally: bool = False, loads: Incomplete | None = None): ...
|
||||
@@ -0,0 +1,488 @@
|
||||
from collections.abc import Callable, Iterable, Mapping, Sequence
|
||||
from types import TracebackType
|
||||
from typing import Any, TypeVar, overload
|
||||
from typing_extensions import Literal, Self, TypeAlias
|
||||
|
||||
import psycopg2
|
||||
import psycopg2.extensions
|
||||
from psycopg2.sql import Composable
|
||||
|
||||
_Vars: TypeAlias = Sequence[Any] | Mapping[str, Any] | None
|
||||
|
||||
BINARY: Any
|
||||
BINARYARRAY: Any
|
||||
BOOLEAN: Any
|
||||
BOOLEANARRAY: Any
|
||||
BYTES: Any
|
||||
BYTESARRAY: Any
|
||||
CIDRARRAY: Any
|
||||
DATE: Any
|
||||
DATEARRAY: Any
|
||||
DATETIME: Any
|
||||
DATETIMEARRAY: Any
|
||||
DATETIMETZ: Any
|
||||
DATETIMETZARRAY: Any
|
||||
DECIMAL: Any
|
||||
DECIMALARRAY: Any
|
||||
FLOAT: Any
|
||||
FLOATARRAY: Any
|
||||
INETARRAY: Any
|
||||
INTEGER: Any
|
||||
INTEGERARRAY: Any
|
||||
INTERVAL: Any
|
||||
INTERVALARRAY: Any
|
||||
LONGINTEGER: Any
|
||||
LONGINTEGERARRAY: Any
|
||||
MACADDRARRAY: Any
|
||||
NUMBER: Any
|
||||
PYDATE: Any
|
||||
PYDATEARRAY: Any
|
||||
PYDATETIME: Any
|
||||
PYDATETIMEARRAY: Any
|
||||
PYDATETIMETZ: Any
|
||||
PYDATETIMETZARRAY: Any
|
||||
PYINTERVAL: Any
|
||||
PYINTERVALARRAY: Any
|
||||
PYTIME: Any
|
||||
PYTIMEARRAY: Any
|
||||
REPLICATION_LOGICAL: int
|
||||
REPLICATION_PHYSICAL: int
|
||||
ROWID: Any
|
||||
ROWIDARRAY: Any
|
||||
STRING: Any
|
||||
STRINGARRAY: Any
|
||||
TIME: Any
|
||||
TIMEARRAY: Any
|
||||
UNICODE: Any
|
||||
UNICODEARRAY: Any
|
||||
UNKNOWN: Any
|
||||
adapters: dict[Any, Any]
|
||||
apilevel: str
|
||||
binary_types: dict[Any, Any]
|
||||
encodings: dict[Any, Any]
|
||||
paramstyle: str
|
||||
sqlstate_errors: dict[Any, Any]
|
||||
string_types: dict[Any, Any]
|
||||
threadsafety: int
|
||||
|
||||
__libpq_version__: int
|
||||
|
||||
class cursor:
|
||||
arraysize: int
|
||||
binary_types: Any
|
||||
closed: Any
|
||||
connection: Any
|
||||
description: Any
|
||||
itersize: Any
|
||||
lastrowid: Any
|
||||
name: Any
|
||||
pgresult_ptr: Any
|
||||
query: Any
|
||||
row_factory: Any
|
||||
rowcount: int
|
||||
rownumber: int
|
||||
scrollable: bool | None
|
||||
statusmessage: Any
|
||||
string_types: Any
|
||||
typecaster: Any
|
||||
tzinfo_factory: Any
|
||||
withhold: bool
|
||||
def __init__(self, conn: connection, name: str | bytes | None = ...) -> None: ...
|
||||
def callproc(self, procname, parameters=...): ...
|
||||
def cast(self, oid, s): ...
|
||||
def close(self): ...
|
||||
def copy_expert(self, sql: str | bytes | Composable, file, size=...): ...
|
||||
def copy_from(self, file, table, sep=..., null=..., size=..., columns=...): ...
|
||||
def copy_to(self, file, table, sep=..., null=..., columns=...): ...
|
||||
def execute(self, query: str | bytes | Composable, vars: _Vars = ...) -> None: ...
|
||||
def executemany(self, query: str | bytes | Composable, vars_list: Iterable[_Vars]) -> None: ...
|
||||
def fetchall(self) -> list[tuple[Any, ...]]: ...
|
||||
def fetchmany(self, size: int | None = ...) -> list[tuple[Any, ...]]: ...
|
||||
def fetchone(self) -> tuple[Any, ...] | None: ...
|
||||
def mogrify(self, *args, **kwargs): ...
|
||||
def nextset(self): ...
|
||||
def scroll(self, value, mode=...): ...
|
||||
def setinputsizes(self, sizes): ...
|
||||
def setoutputsize(self, size, column=...): ...
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(
|
||||
self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
|
||||
) -> None: ...
|
||||
def __iter__(self) -> Self: ...
|
||||
def __next__(self) -> tuple[Any, ...]: ...
|
||||
|
||||
_Cursor: TypeAlias = cursor
|
||||
|
||||
class AsIs:
|
||||
adapted: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def getquoted(self, *args, **kwargs): ...
|
||||
def __conform__(self, *args, **kwargs): ...
|
||||
|
||||
class Binary:
|
||||
adapted: Any
|
||||
buffer: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def getquoted(self, *args, **kwargs): ...
|
||||
def prepare(self, conn): ...
|
||||
def __conform__(self, *args, **kwargs): ...
|
||||
|
||||
class Boolean:
|
||||
adapted: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def getquoted(self, *args, **kwargs): ...
|
||||
def __conform__(self, *args, **kwargs): ...
|
||||
|
||||
class Column:
|
||||
display_size: Any
|
||||
internal_size: Any
|
||||
name: Any
|
||||
null_ok: Any
|
||||
precision: Any
|
||||
scale: Any
|
||||
table_column: Any
|
||||
table_oid: Any
|
||||
type_code: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def __eq__(self, __other): ...
|
||||
def __ge__(self, __other): ...
|
||||
def __getitem__(self, __index): ...
|
||||
def __getstate__(self): ...
|
||||
def __gt__(self, __other): ...
|
||||
def __le__(self, __other): ...
|
||||
def __len__(self) -> int: ...
|
||||
def __lt__(self, __other): ...
|
||||
def __ne__(self, __other): ...
|
||||
def __setstate__(self, state): ...
|
||||
|
||||
class ConnectionInfo:
|
||||
# Note: the following properties can be None if their corresponding libpq function
|
||||
# returns NULL. They're not annotated as such, because this is very unlikely in
|
||||
# practice---the psycopg2 docs [1] don't even mention this as a possibility!
|
||||
#
|
||||
# - db_name
|
||||
# - user
|
||||
# - password
|
||||
# - host
|
||||
# - port
|
||||
# - options
|
||||
#
|
||||
# (To prove this, one needs to inspect the psycopg2 source code [2], plus the
|
||||
# documentation [3] and source code [4] of the corresponding libpq calls.)
|
||||
#
|
||||
# [1]: https://www.psycopg.org/docs/extensions.html#psycopg2.extensions.ConnectionInfo
|
||||
# [2]: https://github.com/psycopg/psycopg2/blob/1d3a89a0bba621dc1cc9b32db6d241bd2da85ad1/psycopg/conninfo_type.c#L52 and below
|
||||
# [3]: https://www.postgresql.org/docs/current/libpq-status.html
|
||||
# [4]: https://github.com/postgres/postgres/blob/b39838889e76274b107935fa8e8951baf0e8b31b/src/interfaces/libpq/fe-connect.c#L6754 and below
|
||||
@property
|
||||
def backend_pid(self) -> int: ...
|
||||
@property
|
||||
def dbname(self) -> str: ...
|
||||
@property
|
||||
def dsn_parameters(self) -> dict[str, str]: ...
|
||||
@property
|
||||
def error_message(self) -> str | None: ...
|
||||
@property
|
||||
def host(self) -> str: ...
|
||||
@property
|
||||
def needs_password(self) -> bool: ...
|
||||
@property
|
||||
def options(self) -> str: ...
|
||||
@property
|
||||
def password(self) -> str: ...
|
||||
@property
|
||||
def port(self) -> int: ...
|
||||
@property
|
||||
def protocol_version(self) -> int: ...
|
||||
@property
|
||||
def server_version(self) -> int: ...
|
||||
@property
|
||||
def socket(self) -> int: ...
|
||||
@property
|
||||
def ssl_attribute_names(self) -> list[str]: ...
|
||||
@property
|
||||
def ssl_in_use(self) -> bool: ...
|
||||
@property
|
||||
def status(self) -> int: ...
|
||||
@property
|
||||
def transaction_status(self) -> int: ...
|
||||
@property
|
||||
def used_password(self) -> bool: ...
|
||||
@property
|
||||
def user(self) -> str: ...
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def parameter_status(self, name: str) -> str | None: ...
|
||||
def ssl_attribute(self, name: str) -> str | None: ...
|
||||
|
||||
class DataError(psycopg2.DatabaseError): ...
|
||||
class DatabaseError(psycopg2.Error): ...
|
||||
|
||||
class Decimal:
|
||||
adapted: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def getquoted(self, *args, **kwargs): ...
|
||||
def __conform__(self, *args, **kwargs): ...
|
||||
|
||||
class Diagnostics:
|
||||
column_name: str | None
|
||||
constraint_name: str | None
|
||||
context: str | None
|
||||
datatype_name: str | None
|
||||
internal_position: str | None
|
||||
internal_query: str | None
|
||||
message_detail: str | None
|
||||
message_hint: str | None
|
||||
message_primary: str | None
|
||||
schema_name: str | None
|
||||
severity: str | None
|
||||
severity_nonlocalized: str | None
|
||||
source_file: str | None
|
||||
source_function: str | None
|
||||
source_line: str | None
|
||||
sqlstate: str | None
|
||||
statement_position: str | None
|
||||
table_name: str | None
|
||||
def __init__(self, __err: Error) -> None: ...
|
||||
|
||||
class Error(Exception):
|
||||
cursor: _Cursor | None
|
||||
diag: Diagnostics
|
||||
pgcode: str | None
|
||||
pgerror: str | None
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def __reduce__(self): ...
|
||||
def __setstate__(self, state): ...
|
||||
|
||||
class Float:
|
||||
adapted: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def getquoted(self, *args, **kwargs): ...
|
||||
def __conform__(self, *args, **kwargs): ...
|
||||
|
||||
class ISQLQuote:
|
||||
_wrapped: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def getbinary(self, *args, **kwargs): ...
|
||||
def getbuffer(self, *args, **kwargs): ...
|
||||
def getquoted(self, *args, **kwargs) -> bytes: ...
|
||||
|
||||
class Int:
|
||||
adapted: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def getquoted(self, *args, **kwargs): ...
|
||||
def __conform__(self, *args, **kwargs): ...
|
||||
|
||||
class IntegrityError(psycopg2.DatabaseError): ...
|
||||
class InterfaceError(psycopg2.Error): ...
|
||||
class InternalError(psycopg2.DatabaseError): ...
|
||||
|
||||
class List:
|
||||
adapted: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def getquoted(self, *args, **kwargs): ...
|
||||
def prepare(self, *args, **kwargs): ...
|
||||
def __conform__(self, *args, **kwargs): ...
|
||||
|
||||
class NotSupportedError(psycopg2.DatabaseError): ...
|
||||
|
||||
class Notify:
|
||||
channel: Any
|
||||
payload: Any
|
||||
pid: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def __eq__(self, __other): ...
|
||||
def __ge__(self, __other): ...
|
||||
def __getitem__(self, __index): ...
|
||||
def __gt__(self, __other): ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __le__(self, __other): ...
|
||||
def __len__(self) -> int: ...
|
||||
def __lt__(self, __other): ...
|
||||
def __ne__(self, __other): ...
|
||||
|
||||
class OperationalError(psycopg2.DatabaseError): ...
|
||||
class ProgrammingError(psycopg2.DatabaseError): ...
|
||||
class QueryCanceledError(psycopg2.OperationalError): ...
|
||||
|
||||
class QuotedString:
|
||||
adapted: Any
|
||||
buffer: Any
|
||||
encoding: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def getquoted(self, *args, **kwargs): ...
|
||||
def prepare(self, *args, **kwargs): ...
|
||||
def __conform__(self, *args, **kwargs): ...
|
||||
|
||||
class ReplicationConnection(psycopg2.extensions.connection):
|
||||
autocommit: Any
|
||||
isolation_level: Any
|
||||
replication_type: Any
|
||||
reset: Any
|
||||
set_isolation_level: Any
|
||||
set_session: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
|
||||
class ReplicationCursor(cursor):
|
||||
feedback_timestamp: Any
|
||||
io_timestamp: Any
|
||||
wal_end: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def consume_stream(self, consumer, keepalive_interval=...): ...
|
||||
def read_message(self, *args, **kwargs): ...
|
||||
def send_feedback(self, write_lsn=..., flush_lsn=..., apply_lsn=..., reply=..., force=...): ...
|
||||
def start_replication_expert(self, command, decode=..., status_interval=...): ...
|
||||
|
||||
class ReplicationMessage:
|
||||
cursor: Any
|
||||
data_size: Any
|
||||
data_start: Any
|
||||
payload: Any
|
||||
send_time: Any
|
||||
wal_end: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
|
||||
class TransactionRollbackError(psycopg2.OperationalError): ...
|
||||
class Warning(Exception): ...
|
||||
|
||||
class Xid:
|
||||
bqual: Any
|
||||
database: Any
|
||||
format_id: Any
|
||||
gtrid: Any
|
||||
owner: Any
|
||||
prepared: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def from_string(self, *args, **kwargs): ...
|
||||
def __getitem__(self, __index): ...
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
_T_cur = TypeVar("_T_cur", bound=cursor)
|
||||
|
||||
class connection:
|
||||
DataError: Any
|
||||
DatabaseError: Any
|
||||
Error: Any
|
||||
IntegrityError: Any
|
||||
InterfaceError: Any
|
||||
InternalError: Any
|
||||
NotSupportedError: Any
|
||||
OperationalError: Any
|
||||
ProgrammingError: Any
|
||||
Warning: Any
|
||||
@property
|
||||
def async_(self) -> int: ...
|
||||
autocommit: bool
|
||||
@property
|
||||
def binary_types(self) -> Any: ...
|
||||
@property
|
||||
def closed(self) -> int: ...
|
||||
cursor_factory: Callable[..., _Cursor]
|
||||
@property
|
||||
def dsn(self) -> str: ...
|
||||
@property
|
||||
def encoding(self) -> str: ...
|
||||
@property
|
||||
def info(self) -> ConnectionInfo: ...
|
||||
@property
|
||||
def isolation_level(self) -> int | None: ...
|
||||
@isolation_level.setter
|
||||
def isolation_level(self, __value: str | bytes | int | None) -> None: ...
|
||||
notices: list[Any]
|
||||
notifies: list[Any]
|
||||
@property
|
||||
def pgconn_ptr(self) -> int | None: ...
|
||||
@property
|
||||
def protocol_version(self) -> int: ...
|
||||
@property
|
||||
def deferrable(self) -> bool | None: ...
|
||||
@deferrable.setter
|
||||
def deferrable(self, __value: Literal["default"] | bool | None) -> None: ...
|
||||
@property
|
||||
def readonly(self) -> bool | None: ...
|
||||
@readonly.setter
|
||||
def readonly(self, __value: Literal["default"] | bool | None) -> None: ...
|
||||
@property
|
||||
def server_version(self) -> int: ...
|
||||
@property
|
||||
def status(self) -> int: ...
|
||||
@property
|
||||
def string_types(self) -> Any: ...
|
||||
# Really it's dsn: str, async: int = ..., async_: int = ..., but
|
||||
# that would be a syntax error.
|
||||
def __init__(self, dsn: str, *, async_: int = ...) -> None: ...
|
||||
def cancel(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def commit(self) -> None: ...
|
||||
@overload
|
||||
def cursor(self, name: str | bytes | None = ..., *, withhold: bool = ..., scrollable: bool | None = ...) -> _Cursor: ...
|
||||
def fileno(self) -> int: ...
|
||||
def get_backend_pid(self) -> int: ...
|
||||
def get_dsn_parameters(self) -> dict[str, str]: ...
|
||||
def get_native_connection(self): ...
|
||||
def get_parameter_status(self, parameter: str) -> str | None: ...
|
||||
def get_transaction_status(self) -> int: ...
|
||||
def isexecuting(self) -> bool: ...
|
||||
def lobject(
|
||||
self,
|
||||
oid: int = ...,
|
||||
mode: str | None = ...,
|
||||
new_oid: int = ...,
|
||||
new_file: str | None = ...,
|
||||
lobject_factory: type[lobject] = ...,
|
||||
) -> lobject: ...
|
||||
def poll(self) -> int: ...
|
||||
def reset(self) -> None: ...
|
||||
def rollback(self) -> None: ...
|
||||
def set_client_encoding(self, encoding: str) -> None: ...
|
||||
def set_isolation_level(self, level: int | None) -> None: ...
|
||||
def set_session(
|
||||
self,
|
||||
isolation_level: str | bytes | int | None = ...,
|
||||
readonly: bool | Literal["default", b"default"] | None = ...,
|
||||
deferrable: bool | Literal["default", b"default"] | None = ...,
|
||||
autocommit: bool = ...,
|
||||
) -> None: ...
|
||||
def tpc_begin(self, xid: str | bytes | Xid) -> None: ...
|
||||
def tpc_commit(self, __xid: str | bytes | Xid = ...) -> None: ...
|
||||
def tpc_prepare(self) -> None: ...
|
||||
def tpc_recover(self) -> list[Xid]: ...
|
||||
def tpc_rollback(self, __xid: str | bytes | Xid = ...) -> None: ...
|
||||
def xid(self, format_id, gtrid, bqual) -> Xid: ...
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(self, __type: type[BaseException] | None, __name: BaseException | None, __tb: TracebackType | None) -> None: ...
|
||||
|
||||
class lobject:
|
||||
closed: Any
|
||||
mode: Any
|
||||
oid: Any
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def close(self): ...
|
||||
def export(self, filename): ...
|
||||
def read(self, size=...): ...
|
||||
def seek(self, offset, whence=...): ...
|
||||
def tell(self): ...
|
||||
def truncate(self, len=...): ...
|
||||
def unlink(self): ...
|
||||
def write(self, str): ...
|
||||
|
||||
def Date(year, month, day): ...
|
||||
def DateFromPy(*args, **kwargs): ...
|
||||
def DateFromTicks(ticks): ...
|
||||
def IntervalFromPy(*args, **kwargs): ...
|
||||
def Time(hour, minutes, seconds, tzinfo=...): ...
|
||||
def TimeFromPy(*args, **kwargs): ...
|
||||
def TimeFromTicks(ticks): ...
|
||||
def Timestamp(year, month, day, hour, minutes, seconds, tzinfo=...): ...
|
||||
def TimestampFromPy(*args, **kwargs): ...
|
||||
def TimestampFromTicks(ticks): ...
|
||||
def _connect(*args, **kwargs): ...
|
||||
def adapt(*args, **kwargs): ...
|
||||
def encrypt_password(*args, **kwargs): ...
|
||||
def get_wait_callback(*args, **kwargs): ...
|
||||
def libpq_version(*args, **kwargs): ...
|
||||
def new_array_type(oids, name, baseobj): ...
|
||||
def new_type(oids, name, castobj): ...
|
||||
def parse_dsn(dsn: str | bytes) -> dict[str, Any]: ...
|
||||
def quote_ident(value: Any, scope: connection | cursor | None) -> str: ...
|
||||
def register_type(*args, **kwargs): ...
|
||||
def set_wait_callback(_none): ...
|
||||
@@ -0,0 +1,62 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import Any
|
||||
|
||||
class Range:
|
||||
def __init__(
|
||||
self, lower: Incomplete | None = None, upper: Incomplete | None = None, bounds: str = "[)", empty: bool = False
|
||||
) -> None: ...
|
||||
@property
|
||||
def lower(self): ...
|
||||
@property
|
||||
def upper(self): ...
|
||||
@property
|
||||
def isempty(self): ...
|
||||
@property
|
||||
def lower_inf(self): ...
|
||||
@property
|
||||
def upper_inf(self): ...
|
||||
@property
|
||||
def lower_inc(self): ...
|
||||
@property
|
||||
def upper_inc(self): ...
|
||||
def __contains__(self, x): ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __eq__(self, other): ...
|
||||
def __ne__(self, other): ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __lt__(self, other): ...
|
||||
def __le__(self, other): ...
|
||||
def __gt__(self, other): ...
|
||||
def __ge__(self, other): ...
|
||||
|
||||
def register_range(pgrange, pyrange, conn_or_curs, globally: bool = False): ...
|
||||
|
||||
class RangeAdapter:
|
||||
name: Any
|
||||
adapted: Any
|
||||
def __init__(self, adapted) -> None: ...
|
||||
def __conform__(self, proto): ...
|
||||
def prepare(self, conn) -> None: ...
|
||||
def getquoted(self): ...
|
||||
|
||||
class RangeCaster:
|
||||
subtype_oid: Any
|
||||
typecaster: Any
|
||||
array_typecaster: Any
|
||||
def __init__(self, pgrange, pyrange, oid, subtype_oid, array_oid: Incomplete | None = None) -> None: ...
|
||||
def parse(self, s, cur: Incomplete | None = None): ...
|
||||
|
||||
class NumericRange(Range): ...
|
||||
class DateRange(Range): ...
|
||||
class DateTimeRange(Range): ...
|
||||
class DateTimeTZRange(Range): ...
|
||||
|
||||
class NumberRangeAdapter(RangeAdapter):
|
||||
def getquoted(self): ...
|
||||
|
||||
int4range_caster: Any
|
||||
int8range_caster: Any
|
||||
numrange_caster: Any
|
||||
daterange_caster: Any
|
||||
tsrange_caster: Any
|
||||
tstzrange_caster: Any
|
||||
@@ -0,0 +1,304 @@
|
||||
def lookup(code, _cache={}): ...
|
||||
|
||||
CLASS_SUCCESSFUL_COMPLETION: str
|
||||
CLASS_WARNING: str
|
||||
CLASS_NO_DATA: str
|
||||
CLASS_SQL_STATEMENT_NOT_YET_COMPLETE: str
|
||||
CLASS_CONNECTION_EXCEPTION: str
|
||||
CLASS_TRIGGERED_ACTION_EXCEPTION: str
|
||||
CLASS_FEATURE_NOT_SUPPORTED: str
|
||||
CLASS_INVALID_TRANSACTION_INITIATION: str
|
||||
CLASS_LOCATOR_EXCEPTION: str
|
||||
CLASS_INVALID_GRANTOR: str
|
||||
CLASS_INVALID_ROLE_SPECIFICATION: str
|
||||
CLASS_DIAGNOSTICS_EXCEPTION: str
|
||||
CLASS_CASE_NOT_FOUND: str
|
||||
CLASS_CARDINALITY_VIOLATION: str
|
||||
CLASS_DATA_EXCEPTION: str
|
||||
CLASS_INTEGRITY_CONSTRAINT_VIOLATION: str
|
||||
CLASS_INVALID_CURSOR_STATE: str
|
||||
CLASS_INVALID_TRANSACTION_STATE: str
|
||||
CLASS_INVALID_SQL_STATEMENT_NAME: str
|
||||
CLASS_TRIGGERED_DATA_CHANGE_VIOLATION: str
|
||||
CLASS_INVALID_AUTHORIZATION_SPECIFICATION: str
|
||||
CLASS_DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST: str
|
||||
CLASS_INVALID_TRANSACTION_TERMINATION: str
|
||||
CLASS_SQL_ROUTINE_EXCEPTION: str
|
||||
CLASS_INVALID_CURSOR_NAME: str
|
||||
CLASS_EXTERNAL_ROUTINE_EXCEPTION: str
|
||||
CLASS_EXTERNAL_ROUTINE_INVOCATION_EXCEPTION: str
|
||||
CLASS_SAVEPOINT_EXCEPTION: str
|
||||
CLASS_INVALID_CATALOG_NAME: str
|
||||
CLASS_INVALID_SCHEMA_NAME: str
|
||||
CLASS_TRANSACTION_ROLLBACK: str
|
||||
CLASS_SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION: str
|
||||
CLASS_WITH_CHECK_OPTION_VIOLATION: str
|
||||
CLASS_INSUFFICIENT_RESOURCES: str
|
||||
CLASS_PROGRAM_LIMIT_EXCEEDED: str
|
||||
CLASS_OBJECT_NOT_IN_PREREQUISITE_STATE: str
|
||||
CLASS_OPERATOR_INTERVENTION: str
|
||||
CLASS_SYSTEM_ERROR: str
|
||||
CLASS_SNAPSHOT_FAILURE: str
|
||||
CLASS_CONFIGURATION_FILE_ERROR: str
|
||||
CLASS_FOREIGN_DATA_WRAPPER_ERROR: str
|
||||
CLASS_PL_PGSQL_ERROR: str
|
||||
CLASS_INTERNAL_ERROR: str
|
||||
SUCCESSFUL_COMPLETION: str
|
||||
WARNING: str
|
||||
NULL_VALUE_ELIMINATED_IN_SET_FUNCTION: str
|
||||
STRING_DATA_RIGHT_TRUNCATION_: str
|
||||
PRIVILEGE_NOT_REVOKED: str
|
||||
PRIVILEGE_NOT_GRANTED: str
|
||||
IMPLICIT_ZERO_BIT_PADDING: str
|
||||
DYNAMIC_RESULT_SETS_RETURNED: str
|
||||
DEPRECATED_FEATURE: str
|
||||
NO_DATA: str
|
||||
NO_ADDITIONAL_DYNAMIC_RESULT_SETS_RETURNED: str
|
||||
SQL_STATEMENT_NOT_YET_COMPLETE: str
|
||||
CONNECTION_EXCEPTION: str
|
||||
SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION: str
|
||||
CONNECTION_DOES_NOT_EXIST: str
|
||||
SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION: str
|
||||
CONNECTION_FAILURE: str
|
||||
TRANSACTION_RESOLUTION_UNKNOWN: str
|
||||
PROTOCOL_VIOLATION: str
|
||||
TRIGGERED_ACTION_EXCEPTION: str
|
||||
FEATURE_NOT_SUPPORTED: str
|
||||
INVALID_TRANSACTION_INITIATION: str
|
||||
LOCATOR_EXCEPTION: str
|
||||
INVALID_LOCATOR_SPECIFICATION: str
|
||||
INVALID_GRANTOR: str
|
||||
INVALID_GRANT_OPERATION: str
|
||||
INVALID_ROLE_SPECIFICATION: str
|
||||
DIAGNOSTICS_EXCEPTION: str
|
||||
STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER: str
|
||||
CASE_NOT_FOUND: str
|
||||
CARDINALITY_VIOLATION: str
|
||||
DATA_EXCEPTION: str
|
||||
STRING_DATA_RIGHT_TRUNCATION: str
|
||||
NULL_VALUE_NO_INDICATOR_PARAMETER: str
|
||||
NUMERIC_VALUE_OUT_OF_RANGE: str
|
||||
NULL_VALUE_NOT_ALLOWED_: str
|
||||
ERROR_IN_ASSIGNMENT: str
|
||||
INVALID_DATETIME_FORMAT: str
|
||||
DATETIME_FIELD_OVERFLOW: str
|
||||
INVALID_TIME_ZONE_DISPLACEMENT_VALUE: str
|
||||
ESCAPE_CHARACTER_CONFLICT: str
|
||||
INVALID_USE_OF_ESCAPE_CHARACTER: str
|
||||
INVALID_ESCAPE_OCTET: str
|
||||
ZERO_LENGTH_CHARACTER_STRING: str
|
||||
MOST_SPECIFIC_TYPE_MISMATCH: str
|
||||
SEQUENCE_GENERATOR_LIMIT_EXCEEDED: str
|
||||
NOT_AN_XML_DOCUMENT: str
|
||||
INVALID_XML_DOCUMENT: str
|
||||
INVALID_XML_CONTENT: str
|
||||
INVALID_XML_COMMENT: str
|
||||
INVALID_XML_PROCESSING_INSTRUCTION: str
|
||||
INVALID_INDICATOR_PARAMETER_VALUE: str
|
||||
SUBSTRING_ERROR: str
|
||||
DIVISION_BY_ZERO: str
|
||||
INVALID_PRECEDING_OR_FOLLOWING_SIZE: str
|
||||
INVALID_ARGUMENT_FOR_NTILE_FUNCTION: str
|
||||
INTERVAL_FIELD_OVERFLOW: str
|
||||
INVALID_ARGUMENT_FOR_NTH_VALUE_FUNCTION: str
|
||||
INVALID_CHARACTER_VALUE_FOR_CAST: str
|
||||
INVALID_ESCAPE_CHARACTER: str
|
||||
INVALID_REGULAR_EXPRESSION: str
|
||||
INVALID_ARGUMENT_FOR_LOGARITHM: str
|
||||
INVALID_ARGUMENT_FOR_POWER_FUNCTION: str
|
||||
INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION: str
|
||||
INVALID_ROW_COUNT_IN_LIMIT_CLAUSE: str
|
||||
INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE: str
|
||||
INVALID_LIMIT_VALUE: str
|
||||
CHARACTER_NOT_IN_REPERTOIRE: str
|
||||
INDICATOR_OVERFLOW: str
|
||||
INVALID_PARAMETER_VALUE: str
|
||||
UNTERMINATED_C_STRING: str
|
||||
INVALID_ESCAPE_SEQUENCE: str
|
||||
STRING_DATA_LENGTH_MISMATCH: str
|
||||
TRIM_ERROR: str
|
||||
ARRAY_SUBSCRIPT_ERROR: str
|
||||
INVALID_TABLESAMPLE_REPEAT: str
|
||||
INVALID_TABLESAMPLE_ARGUMENT: str
|
||||
DUPLICATE_JSON_OBJECT_KEY_VALUE: str
|
||||
INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION: str
|
||||
INVALID_JSON_TEXT: str
|
||||
INVALID_SQL_JSON_SUBSCRIPT: str
|
||||
MORE_THAN_ONE_SQL_JSON_ITEM: str
|
||||
NO_SQL_JSON_ITEM: str
|
||||
NON_NUMERIC_SQL_JSON_ITEM: str
|
||||
NON_UNIQUE_KEYS_IN_A_JSON_OBJECT: str
|
||||
SINGLETON_SQL_JSON_ITEM_REQUIRED: str
|
||||
SQL_JSON_ARRAY_NOT_FOUND: str
|
||||
SQL_JSON_MEMBER_NOT_FOUND: str
|
||||
SQL_JSON_NUMBER_NOT_FOUND: str
|
||||
SQL_JSON_OBJECT_NOT_FOUND: str
|
||||
TOO_MANY_JSON_ARRAY_ELEMENTS: str
|
||||
TOO_MANY_JSON_OBJECT_MEMBERS: str
|
||||
SQL_JSON_SCALAR_REQUIRED: str
|
||||
FLOATING_POINT_EXCEPTION: str
|
||||
INVALID_TEXT_REPRESENTATION: str
|
||||
INVALID_BINARY_REPRESENTATION: str
|
||||
BAD_COPY_FILE_FORMAT: str
|
||||
UNTRANSLATABLE_CHARACTER: str
|
||||
NONSTANDARD_USE_OF_ESCAPE_CHARACTER: str
|
||||
INTEGRITY_CONSTRAINT_VIOLATION: str
|
||||
RESTRICT_VIOLATION: str
|
||||
NOT_NULL_VIOLATION: str
|
||||
FOREIGN_KEY_VIOLATION: str
|
||||
UNIQUE_VIOLATION: str
|
||||
CHECK_VIOLATION: str
|
||||
EXCLUSION_VIOLATION: str
|
||||
INVALID_CURSOR_STATE: str
|
||||
INVALID_TRANSACTION_STATE: str
|
||||
ACTIVE_SQL_TRANSACTION: str
|
||||
BRANCH_TRANSACTION_ALREADY_ACTIVE: str
|
||||
INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION: str
|
||||
INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION: str
|
||||
NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION: str
|
||||
READ_ONLY_SQL_TRANSACTION: str
|
||||
SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED: str
|
||||
HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL: str
|
||||
NO_ACTIVE_SQL_TRANSACTION: str
|
||||
IN_FAILED_SQL_TRANSACTION: str
|
||||
IDLE_IN_TRANSACTION_SESSION_TIMEOUT: str
|
||||
INVALID_SQL_STATEMENT_NAME: str
|
||||
TRIGGERED_DATA_CHANGE_VIOLATION: str
|
||||
INVALID_AUTHORIZATION_SPECIFICATION: str
|
||||
INVALID_PASSWORD: str
|
||||
DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST: str
|
||||
DEPENDENT_OBJECTS_STILL_EXIST: str
|
||||
INVALID_TRANSACTION_TERMINATION: str
|
||||
SQL_ROUTINE_EXCEPTION: str
|
||||
MODIFYING_SQL_DATA_NOT_PERMITTED_: str
|
||||
PROHIBITED_SQL_STATEMENT_ATTEMPTED_: str
|
||||
READING_SQL_DATA_NOT_PERMITTED_: str
|
||||
FUNCTION_EXECUTED_NO_RETURN_STATEMENT: str
|
||||
INVALID_CURSOR_NAME: str
|
||||
EXTERNAL_ROUTINE_EXCEPTION: str
|
||||
CONTAINING_SQL_NOT_PERMITTED: str
|
||||
MODIFYING_SQL_DATA_NOT_PERMITTED: str
|
||||
PROHIBITED_SQL_STATEMENT_ATTEMPTED: str
|
||||
READING_SQL_DATA_NOT_PERMITTED: str
|
||||
EXTERNAL_ROUTINE_INVOCATION_EXCEPTION: str
|
||||
INVALID_SQLSTATE_RETURNED: str
|
||||
NULL_VALUE_NOT_ALLOWED: str
|
||||
TRIGGER_PROTOCOL_VIOLATED: str
|
||||
SRF_PROTOCOL_VIOLATED: str
|
||||
EVENT_TRIGGER_PROTOCOL_VIOLATED: str
|
||||
SAVEPOINT_EXCEPTION: str
|
||||
INVALID_SAVEPOINT_SPECIFICATION: str
|
||||
INVALID_CATALOG_NAME: str
|
||||
INVALID_SCHEMA_NAME: str
|
||||
TRANSACTION_ROLLBACK: str
|
||||
SERIALIZATION_FAILURE: str
|
||||
TRANSACTION_INTEGRITY_CONSTRAINT_VIOLATION: str
|
||||
STATEMENT_COMPLETION_UNKNOWN: str
|
||||
DEADLOCK_DETECTED: str
|
||||
SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION: str
|
||||
INSUFFICIENT_PRIVILEGE: str
|
||||
SYNTAX_ERROR: str
|
||||
INVALID_NAME: str
|
||||
INVALID_COLUMN_DEFINITION: str
|
||||
NAME_TOO_LONG: str
|
||||
DUPLICATE_COLUMN: str
|
||||
AMBIGUOUS_COLUMN: str
|
||||
UNDEFINED_COLUMN: str
|
||||
UNDEFINED_OBJECT: str
|
||||
DUPLICATE_OBJECT: str
|
||||
DUPLICATE_ALIAS: str
|
||||
DUPLICATE_FUNCTION: str
|
||||
AMBIGUOUS_FUNCTION: str
|
||||
GROUPING_ERROR: str
|
||||
DATATYPE_MISMATCH: str
|
||||
WRONG_OBJECT_TYPE: str
|
||||
INVALID_FOREIGN_KEY: str
|
||||
CANNOT_COERCE: str
|
||||
UNDEFINED_FUNCTION: str
|
||||
GENERATED_ALWAYS: str
|
||||
RESERVED_NAME: str
|
||||
UNDEFINED_TABLE: str
|
||||
UNDEFINED_PARAMETER: str
|
||||
DUPLICATE_CURSOR: str
|
||||
DUPLICATE_DATABASE: str
|
||||
DUPLICATE_PREPARED_STATEMENT: str
|
||||
DUPLICATE_SCHEMA: str
|
||||
DUPLICATE_TABLE: str
|
||||
AMBIGUOUS_PARAMETER: str
|
||||
AMBIGUOUS_ALIAS: str
|
||||
INVALID_COLUMN_REFERENCE: str
|
||||
INVALID_CURSOR_DEFINITION: str
|
||||
INVALID_DATABASE_DEFINITION: str
|
||||
INVALID_FUNCTION_DEFINITION: str
|
||||
INVALID_PREPARED_STATEMENT_DEFINITION: str
|
||||
INVALID_SCHEMA_DEFINITION: str
|
||||
INVALID_TABLE_DEFINITION: str
|
||||
INVALID_OBJECT_DEFINITION: str
|
||||
INDETERMINATE_DATATYPE: str
|
||||
INVALID_RECURSION: str
|
||||
WINDOWING_ERROR: str
|
||||
COLLATION_MISMATCH: str
|
||||
INDETERMINATE_COLLATION: str
|
||||
WITH_CHECK_OPTION_VIOLATION: str
|
||||
INSUFFICIENT_RESOURCES: str
|
||||
DISK_FULL: str
|
||||
OUT_OF_MEMORY: str
|
||||
TOO_MANY_CONNECTIONS: str
|
||||
CONFIGURATION_LIMIT_EXCEEDED: str
|
||||
PROGRAM_LIMIT_EXCEEDED: str
|
||||
STATEMENT_TOO_COMPLEX: str
|
||||
TOO_MANY_COLUMNS: str
|
||||
TOO_MANY_ARGUMENTS: str
|
||||
OBJECT_NOT_IN_PREREQUISITE_STATE: str
|
||||
OBJECT_IN_USE: str
|
||||
CANT_CHANGE_RUNTIME_PARAM: str
|
||||
LOCK_NOT_AVAILABLE: str
|
||||
UNSAFE_NEW_ENUM_VALUE_USAGE: str
|
||||
OPERATOR_INTERVENTION: str
|
||||
QUERY_CANCELED: str
|
||||
ADMIN_SHUTDOWN: str
|
||||
CRASH_SHUTDOWN: str
|
||||
CANNOT_CONNECT_NOW: str
|
||||
DATABASE_DROPPED: str
|
||||
SYSTEM_ERROR: str
|
||||
IO_ERROR: str
|
||||
UNDEFINED_FILE: str
|
||||
DUPLICATE_FILE: str
|
||||
SNAPSHOT_TOO_OLD: str
|
||||
CONFIG_FILE_ERROR: str
|
||||
LOCK_FILE_EXISTS: str
|
||||
FDW_ERROR: str
|
||||
FDW_OUT_OF_MEMORY: str
|
||||
FDW_DYNAMIC_PARAMETER_VALUE_NEEDED: str
|
||||
FDW_INVALID_DATA_TYPE: str
|
||||
FDW_COLUMN_NAME_NOT_FOUND: str
|
||||
FDW_INVALID_DATA_TYPE_DESCRIPTORS: str
|
||||
FDW_INVALID_COLUMN_NAME: str
|
||||
FDW_INVALID_COLUMN_NUMBER: str
|
||||
FDW_INVALID_USE_OF_NULL_POINTER: str
|
||||
FDW_INVALID_STRING_FORMAT: str
|
||||
FDW_INVALID_HANDLE: str
|
||||
FDW_INVALID_OPTION_INDEX: str
|
||||
FDW_INVALID_OPTION_NAME: str
|
||||
FDW_OPTION_NAME_NOT_FOUND: str
|
||||
FDW_REPLY_HANDLE: str
|
||||
FDW_UNABLE_TO_CREATE_EXECUTION: str
|
||||
FDW_UNABLE_TO_CREATE_REPLY: str
|
||||
FDW_UNABLE_TO_ESTABLISH_CONNECTION: str
|
||||
FDW_NO_SCHEMAS: str
|
||||
FDW_SCHEMA_NOT_FOUND: str
|
||||
FDW_TABLE_NOT_FOUND: str
|
||||
FDW_FUNCTION_SEQUENCE_ERROR: str
|
||||
FDW_TOO_MANY_HANDLES: str
|
||||
FDW_INCONSISTENT_DESCRIPTOR_INFORMATION: str
|
||||
FDW_INVALID_ATTRIBUTE_VALUE: str
|
||||
FDW_INVALID_STRING_LENGTH_OR_BUFFER_LENGTH: str
|
||||
FDW_INVALID_DESCRIPTOR_FIELD_IDENTIFIER: str
|
||||
PLPGSQL_ERROR: str
|
||||
RAISE_EXCEPTION: str
|
||||
NO_DATA_FOUND: str
|
||||
TOO_MANY_ROWS: str
|
||||
ASSERT_FAILURE: str
|
||||
INTERNAL_ERROR: str
|
||||
DATA_CORRUPTED: str
|
||||
INDEX_CORRUPTED: str
|
||||
@@ -0,0 +1,263 @@
|
||||
from psycopg2._psycopg import Error as Error, Warning as Warning
|
||||
|
||||
class DatabaseError(Error): ...
|
||||
class InterfaceError(Error): ...
|
||||
class DataError(DatabaseError): ...
|
||||
class DiagnosticsException(DatabaseError): ...
|
||||
class IntegrityError(DatabaseError): ...
|
||||
class InternalError(DatabaseError): ...
|
||||
class InvalidGrantOperation(DatabaseError): ...
|
||||
class InvalidGrantor(DatabaseError): ...
|
||||
class InvalidLocatorSpecification(DatabaseError): ...
|
||||
class InvalidRoleSpecification(DatabaseError): ...
|
||||
class InvalidTransactionInitiation(DatabaseError): ...
|
||||
class LocatorException(DatabaseError): ...
|
||||
class NoAdditionalDynamicResultSetsReturned(DatabaseError): ...
|
||||
class NoData(DatabaseError): ...
|
||||
class NotSupportedError(DatabaseError): ...
|
||||
class OperationalError(DatabaseError): ...
|
||||
class ProgrammingError(DatabaseError): ...
|
||||
class SnapshotTooOld(DatabaseError): ...
|
||||
class SqlStatementNotYetComplete(DatabaseError): ...
|
||||
class StackedDiagnosticsAccessedWithoutActiveHandler(DatabaseError): ...
|
||||
class TriggeredActionException(DatabaseError): ...
|
||||
class ActiveSqlTransaction(InternalError): ...
|
||||
class AdminShutdown(OperationalError): ...
|
||||
class AmbiguousAlias(ProgrammingError): ...
|
||||
class AmbiguousColumn(ProgrammingError): ...
|
||||
class AmbiguousFunction(ProgrammingError): ...
|
||||
class AmbiguousParameter(ProgrammingError): ...
|
||||
class ArraySubscriptError(DataError): ...
|
||||
class AssertFailure(InternalError): ...
|
||||
class BadCopyFileFormat(DataError): ...
|
||||
class BranchTransactionAlreadyActive(InternalError): ...
|
||||
class CannotCoerce(ProgrammingError): ...
|
||||
class CannotConnectNow(OperationalError): ...
|
||||
class CantChangeRuntimeParam(OperationalError): ...
|
||||
class CardinalityViolation(ProgrammingError): ...
|
||||
class CaseNotFound(ProgrammingError): ...
|
||||
class CharacterNotInRepertoire(DataError): ...
|
||||
class CheckViolation(IntegrityError): ...
|
||||
class CollationMismatch(ProgrammingError): ...
|
||||
class ConfigFileError(InternalError): ...
|
||||
class ConfigurationLimitExceeded(OperationalError): ...
|
||||
class ConnectionDoesNotExist(OperationalError): ...
|
||||
class ConnectionException(OperationalError): ...
|
||||
class ConnectionFailure(OperationalError): ...
|
||||
class ContainingSqlNotPermitted(InternalError): ...
|
||||
class CrashShutdown(OperationalError): ...
|
||||
class DataCorrupted(InternalError): ...
|
||||
class DataException(DataError): ...
|
||||
class DatabaseDropped(OperationalError): ...
|
||||
class DatatypeMismatch(ProgrammingError): ...
|
||||
class DatetimeFieldOverflow(DataError): ...
|
||||
class DependentObjectsStillExist(InternalError): ...
|
||||
class DependentPrivilegeDescriptorsStillExist(InternalError): ...
|
||||
class DiskFull(OperationalError): ...
|
||||
class DivisionByZero(DataError): ...
|
||||
class DuplicateAlias(ProgrammingError): ...
|
||||
class DuplicateColumn(ProgrammingError): ...
|
||||
class DuplicateCursor(ProgrammingError): ...
|
||||
class DuplicateDatabase(ProgrammingError): ...
|
||||
class DuplicateFile(OperationalError): ...
|
||||
class DuplicateFunction(ProgrammingError): ...
|
||||
class DuplicateJsonObjectKeyValue(DataError): ...
|
||||
class DuplicateObject(ProgrammingError): ...
|
||||
class DuplicatePreparedStatement(ProgrammingError): ...
|
||||
class DuplicateSchema(ProgrammingError): ...
|
||||
class DuplicateTable(ProgrammingError): ...
|
||||
class ErrorInAssignment(DataError): ...
|
||||
class EscapeCharacterConflict(DataError): ...
|
||||
class EventTriggerProtocolViolated(InternalError): ...
|
||||
class ExclusionViolation(IntegrityError): ...
|
||||
class ExternalRoutineException(InternalError): ...
|
||||
class ExternalRoutineInvocationException(InternalError): ...
|
||||
class FdwColumnNameNotFound(OperationalError): ...
|
||||
class FdwDynamicParameterValueNeeded(OperationalError): ...
|
||||
class FdwError(OperationalError): ...
|
||||
class FdwFunctionSequenceError(OperationalError): ...
|
||||
class FdwInconsistentDescriptorInformation(OperationalError): ...
|
||||
class FdwInvalidAttributeValue(OperationalError): ...
|
||||
class FdwInvalidColumnName(OperationalError): ...
|
||||
class FdwInvalidColumnNumber(OperationalError): ...
|
||||
class FdwInvalidDataType(OperationalError): ...
|
||||
class FdwInvalidDataTypeDescriptors(OperationalError): ...
|
||||
class FdwInvalidDescriptorFieldIdentifier(OperationalError): ...
|
||||
class FdwInvalidHandle(OperationalError): ...
|
||||
class FdwInvalidOptionIndex(OperationalError): ...
|
||||
class FdwInvalidOptionName(OperationalError): ...
|
||||
class FdwInvalidStringFormat(OperationalError): ...
|
||||
class FdwInvalidStringLengthOrBufferLength(OperationalError): ...
|
||||
class FdwInvalidUseOfNullPointer(OperationalError): ...
|
||||
class FdwNoSchemas(OperationalError): ...
|
||||
class FdwOptionNameNotFound(OperationalError): ...
|
||||
class FdwOutOfMemory(OperationalError): ...
|
||||
class FdwReplyHandle(OperationalError): ...
|
||||
class FdwSchemaNotFound(OperationalError): ...
|
||||
class FdwTableNotFound(OperationalError): ...
|
||||
class FdwTooManyHandles(OperationalError): ...
|
||||
class FdwUnableToCreateExecution(OperationalError): ...
|
||||
class FdwUnableToCreateReply(OperationalError): ...
|
||||
class FdwUnableToEstablishConnection(OperationalError): ...
|
||||
class FeatureNotSupported(NotSupportedError): ...
|
||||
class FloatingPointException(DataError): ...
|
||||
class ForeignKeyViolation(IntegrityError): ...
|
||||
class FunctionExecutedNoReturnStatement(InternalError): ...
|
||||
class GeneratedAlways(ProgrammingError): ...
|
||||
class GroupingError(ProgrammingError): ...
|
||||
class HeldCursorRequiresSameIsolationLevel(InternalError): ...
|
||||
class IdleInTransactionSessionTimeout(InternalError): ...
|
||||
class InFailedSqlTransaction(InternalError): ...
|
||||
class InappropriateAccessModeForBranchTransaction(InternalError): ...
|
||||
class InappropriateIsolationLevelForBranchTransaction(InternalError): ...
|
||||
class IndeterminateCollation(ProgrammingError): ...
|
||||
class IndeterminateDatatype(ProgrammingError): ...
|
||||
class IndexCorrupted(InternalError): ...
|
||||
class IndicatorOverflow(DataError): ...
|
||||
class InsufficientPrivilege(ProgrammingError): ...
|
||||
class InsufficientResources(OperationalError): ...
|
||||
class IntegrityConstraintViolation(IntegrityError): ...
|
||||
class InternalError_(InternalError): ...
|
||||
class IntervalFieldOverflow(DataError): ...
|
||||
class InvalidArgumentForLogarithm(DataError): ...
|
||||
class InvalidArgumentForNthValueFunction(DataError): ...
|
||||
class InvalidArgumentForNtileFunction(DataError): ...
|
||||
class InvalidArgumentForPowerFunction(DataError): ...
|
||||
class InvalidArgumentForSqlJsonDatetimeFunction(DataError): ...
|
||||
class InvalidArgumentForWidthBucketFunction(DataError): ...
|
||||
class InvalidAuthorizationSpecification(OperationalError): ...
|
||||
class InvalidBinaryRepresentation(DataError): ...
|
||||
class InvalidCatalogName(ProgrammingError): ...
|
||||
class InvalidCharacterValueForCast(DataError): ...
|
||||
class InvalidColumnDefinition(ProgrammingError): ...
|
||||
class InvalidColumnReference(ProgrammingError): ...
|
||||
class InvalidCursorDefinition(ProgrammingError): ...
|
||||
class InvalidCursorName(OperationalError): ...
|
||||
class InvalidCursorState(InternalError): ...
|
||||
class InvalidDatabaseDefinition(ProgrammingError): ...
|
||||
class InvalidDatetimeFormat(DataError): ...
|
||||
class InvalidEscapeCharacter(DataError): ...
|
||||
class InvalidEscapeOctet(DataError): ...
|
||||
class InvalidEscapeSequence(DataError): ...
|
||||
class InvalidForeignKey(ProgrammingError): ...
|
||||
class InvalidFunctionDefinition(ProgrammingError): ...
|
||||
class InvalidIndicatorParameterValue(DataError): ...
|
||||
class InvalidJsonText(DataError): ...
|
||||
class InvalidName(ProgrammingError): ...
|
||||
class InvalidObjectDefinition(ProgrammingError): ...
|
||||
class InvalidParameterValue(DataError): ...
|
||||
class InvalidPassword(OperationalError): ...
|
||||
class InvalidPrecedingOrFollowingSize(DataError): ...
|
||||
class InvalidPreparedStatementDefinition(ProgrammingError): ...
|
||||
class InvalidRecursion(ProgrammingError): ...
|
||||
class InvalidRegularExpression(DataError): ...
|
||||
class InvalidRowCountInLimitClause(DataError): ...
|
||||
class InvalidRowCountInResultOffsetClause(DataError): ...
|
||||
class InvalidSavepointSpecification(InternalError): ...
|
||||
class InvalidSchemaDefinition(ProgrammingError): ...
|
||||
class InvalidSchemaName(ProgrammingError): ...
|
||||
class InvalidSqlJsonSubscript(DataError): ...
|
||||
class InvalidSqlStatementName(OperationalError): ...
|
||||
class InvalidSqlstateReturned(InternalError): ...
|
||||
class InvalidTableDefinition(ProgrammingError): ...
|
||||
class InvalidTablesampleArgument(DataError): ...
|
||||
class InvalidTablesampleRepeat(DataError): ...
|
||||
class InvalidTextRepresentation(DataError): ...
|
||||
class InvalidTimeZoneDisplacementValue(DataError): ...
|
||||
class InvalidTransactionState(InternalError): ...
|
||||
class InvalidTransactionTermination(InternalError): ...
|
||||
class InvalidUseOfEscapeCharacter(DataError): ...
|
||||
class InvalidXmlComment(DataError): ...
|
||||
class InvalidXmlContent(DataError): ...
|
||||
class InvalidXmlDocument(DataError): ...
|
||||
class InvalidXmlProcessingInstruction(DataError): ...
|
||||
class IoError(OperationalError): ...
|
||||
class LockFileExists(InternalError): ...
|
||||
class LockNotAvailable(OperationalError): ...
|
||||
class ModifyingSqlDataNotPermitted(InternalError): ...
|
||||
class ModifyingSqlDataNotPermittedExt(InternalError): ...
|
||||
class MoreThanOneSqlJsonItem(DataError): ...
|
||||
class MostSpecificTypeMismatch(DataError): ...
|
||||
class NameTooLong(ProgrammingError): ...
|
||||
class NoActiveSqlTransaction(InternalError): ...
|
||||
class NoActiveSqlTransactionForBranchTransaction(InternalError): ...
|
||||
class NoDataFound(InternalError): ...
|
||||
class NoSqlJsonItem(DataError): ...
|
||||
class NonNumericSqlJsonItem(DataError): ...
|
||||
class NonUniqueKeysInAJsonObject(DataError): ...
|
||||
class NonstandardUseOfEscapeCharacter(DataError): ...
|
||||
class NotAnXmlDocument(DataError): ...
|
||||
class NotNullViolation(IntegrityError): ...
|
||||
class NullValueNoIndicatorParameter(DataError): ...
|
||||
class NullValueNotAllowed(DataError): ...
|
||||
class NullValueNotAllowedExt(InternalError): ...
|
||||
class NumericValueOutOfRange(DataError): ...
|
||||
class ObjectInUse(OperationalError): ...
|
||||
class ObjectNotInPrerequisiteState(OperationalError): ...
|
||||
class OperatorIntervention(OperationalError): ...
|
||||
class OutOfMemory(OperationalError): ...
|
||||
class PlpgsqlError(InternalError): ...
|
||||
class ProgramLimitExceeded(OperationalError): ...
|
||||
class ProhibitedSqlStatementAttempted(InternalError): ...
|
||||
class ProhibitedSqlStatementAttemptedExt(InternalError): ...
|
||||
class ProtocolViolation(OperationalError): ...
|
||||
class QueryCanceledError(OperationalError): ...
|
||||
class RaiseException(InternalError): ...
|
||||
class ReadOnlySqlTransaction(InternalError): ...
|
||||
class ReadingSqlDataNotPermitted(InternalError): ...
|
||||
class ReadingSqlDataNotPermittedExt(InternalError): ...
|
||||
class ReservedName(ProgrammingError): ...
|
||||
class RestrictViolation(IntegrityError): ...
|
||||
class SavepointException(InternalError): ...
|
||||
class SchemaAndDataStatementMixingNotSupported(InternalError): ...
|
||||
class SequenceGeneratorLimitExceeded(DataError): ...
|
||||
class SingletonSqlJsonItemRequired(DataError): ...
|
||||
class SqlJsonArrayNotFound(DataError): ...
|
||||
class SqlJsonMemberNotFound(DataError): ...
|
||||
class SqlJsonNumberNotFound(DataError): ...
|
||||
class SqlJsonObjectNotFound(DataError): ...
|
||||
class SqlJsonScalarRequired(DataError): ...
|
||||
class SqlRoutineException(InternalError): ...
|
||||
class SqlclientUnableToEstablishSqlconnection(OperationalError): ...
|
||||
class SqlserverRejectedEstablishmentOfSqlconnection(OperationalError): ...
|
||||
class SrfProtocolViolated(InternalError): ...
|
||||
class StatementTooComplex(OperationalError): ...
|
||||
class StringDataLengthMismatch(DataError): ...
|
||||
class StringDataRightTruncation(DataError): ...
|
||||
class SubstringError(DataError): ...
|
||||
class SyntaxError(ProgrammingError): ...
|
||||
class SyntaxErrorOrAccessRuleViolation(ProgrammingError): ...
|
||||
class SystemError(OperationalError): ...
|
||||
class TooManyArguments(OperationalError): ...
|
||||
class TooManyColumns(OperationalError): ...
|
||||
class TooManyConnections(OperationalError): ...
|
||||
class TooManyJsonArrayElements(DataError): ...
|
||||
class TooManyJsonObjectMembers(DataError): ...
|
||||
class TooManyRows(InternalError): ...
|
||||
class TransactionResolutionUnknown(OperationalError): ...
|
||||
class TransactionRollbackError(OperationalError): ...
|
||||
class TriggerProtocolViolated(InternalError): ...
|
||||
class TriggeredDataChangeViolation(OperationalError): ...
|
||||
class TrimError(DataError): ...
|
||||
class UndefinedColumn(ProgrammingError): ...
|
||||
class UndefinedFile(OperationalError): ...
|
||||
class UndefinedFunction(ProgrammingError): ...
|
||||
class UndefinedObject(ProgrammingError): ...
|
||||
class UndefinedParameter(ProgrammingError): ...
|
||||
class UndefinedTable(ProgrammingError): ...
|
||||
class UniqueViolation(IntegrityError): ...
|
||||
class UnsafeNewEnumValueUsage(OperationalError): ...
|
||||
class UnterminatedCString(DataError): ...
|
||||
class UntranslatableCharacter(DataError): ...
|
||||
class WindowingError(ProgrammingError): ...
|
||||
class WithCheckOptionViolation(ProgrammingError): ...
|
||||
class WrongObjectType(ProgrammingError): ...
|
||||
class ZeroLengthCharacterString(DataError): ...
|
||||
class DeadlockDetected(TransactionRollbackError): ...
|
||||
class QueryCanceled(QueryCanceledError): ...
|
||||
class SerializationFailure(TransactionRollbackError): ...
|
||||
class StatementCompletionUnknown(TransactionRollbackError): ...
|
||||
class TransactionIntegrityConstraintViolation(TransactionRollbackError): ...
|
||||
class TransactionRollback(TransactionRollbackError): ...
|
||||
|
||||
def lookup(code): ...
|
||||
@@ -0,0 +1,117 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import Any
|
||||
|
||||
from psycopg2._psycopg import (
|
||||
BINARYARRAY as BINARYARRAY,
|
||||
BOOLEAN as BOOLEAN,
|
||||
BOOLEANARRAY as BOOLEANARRAY,
|
||||
BYTES as BYTES,
|
||||
BYTESARRAY as BYTESARRAY,
|
||||
DATE as DATE,
|
||||
DATEARRAY as DATEARRAY,
|
||||
DATETIMEARRAY as DATETIMEARRAY,
|
||||
DECIMAL as DECIMAL,
|
||||
DECIMALARRAY as DECIMALARRAY,
|
||||
FLOAT as FLOAT,
|
||||
FLOATARRAY as FLOATARRAY,
|
||||
INTEGER as INTEGER,
|
||||
INTEGERARRAY as INTEGERARRAY,
|
||||
INTERVAL as INTERVAL,
|
||||
INTERVALARRAY as INTERVALARRAY,
|
||||
LONGINTEGER as LONGINTEGER,
|
||||
LONGINTEGERARRAY as LONGINTEGERARRAY,
|
||||
PYDATE as PYDATE,
|
||||
PYDATEARRAY as PYDATEARRAY,
|
||||
PYDATETIME as PYDATETIME,
|
||||
PYDATETIMEARRAY as PYDATETIMEARRAY,
|
||||
PYDATETIMETZ as PYDATETIMETZ,
|
||||
PYDATETIMETZARRAY as PYDATETIMETZARRAY,
|
||||
PYINTERVAL as PYINTERVAL,
|
||||
PYINTERVALARRAY as PYINTERVALARRAY,
|
||||
PYTIME as PYTIME,
|
||||
PYTIMEARRAY as PYTIMEARRAY,
|
||||
ROWIDARRAY as ROWIDARRAY,
|
||||
STRINGARRAY as STRINGARRAY,
|
||||
TIME as TIME,
|
||||
TIMEARRAY as TIMEARRAY,
|
||||
UNICODE as UNICODE,
|
||||
UNICODEARRAY as UNICODEARRAY,
|
||||
AsIs as AsIs,
|
||||
Binary as Binary,
|
||||
Boolean as Boolean,
|
||||
Column as Column,
|
||||
ConnectionInfo as ConnectionInfo,
|
||||
DateFromPy as DateFromPy,
|
||||
Diagnostics as Diagnostics,
|
||||
Float as Float,
|
||||
Int as Int,
|
||||
IntervalFromPy as IntervalFromPy,
|
||||
ISQLQuote as ISQLQuote,
|
||||
Notify as Notify,
|
||||
QueryCanceledError as QueryCanceledError,
|
||||
QuotedString as QuotedString,
|
||||
TimeFromPy as TimeFromPy,
|
||||
TimestampFromPy as TimestampFromPy,
|
||||
TransactionRollbackError as TransactionRollbackError,
|
||||
Xid as Xid,
|
||||
adapt as adapt,
|
||||
adapters as adapters,
|
||||
binary_types as binary_types,
|
||||
connection as connection,
|
||||
cursor as cursor,
|
||||
encodings as encodings,
|
||||
encrypt_password as encrypt_password,
|
||||
get_wait_callback as get_wait_callback,
|
||||
libpq_version as libpq_version,
|
||||
lobject as lobject,
|
||||
new_array_type as new_array_type,
|
||||
new_type as new_type,
|
||||
parse_dsn as parse_dsn,
|
||||
quote_ident as quote_ident,
|
||||
register_type as register_type,
|
||||
set_wait_callback as set_wait_callback,
|
||||
string_types as string_types,
|
||||
)
|
||||
|
||||
ISOLATION_LEVEL_AUTOCOMMIT: int
|
||||
ISOLATION_LEVEL_READ_UNCOMMITTED: int
|
||||
ISOLATION_LEVEL_READ_COMMITTED: int
|
||||
ISOLATION_LEVEL_REPEATABLE_READ: int
|
||||
ISOLATION_LEVEL_SERIALIZABLE: int
|
||||
ISOLATION_LEVEL_DEFAULT: Any
|
||||
STATUS_SETUP: int
|
||||
STATUS_READY: int
|
||||
STATUS_BEGIN: int
|
||||
STATUS_SYNC: int
|
||||
STATUS_ASYNC: int
|
||||
STATUS_PREPARED: int
|
||||
STATUS_IN_TRANSACTION: int
|
||||
POLL_OK: int
|
||||
POLL_READ: int
|
||||
POLL_WRITE: int
|
||||
POLL_ERROR: int
|
||||
TRANSACTION_STATUS_IDLE: int
|
||||
TRANSACTION_STATUS_ACTIVE: int
|
||||
TRANSACTION_STATUS_INTRANS: int
|
||||
TRANSACTION_STATUS_INERROR: int
|
||||
TRANSACTION_STATUS_UNKNOWN: int
|
||||
|
||||
def register_adapter(typ, callable) -> None: ...
|
||||
|
||||
class SQL_IN:
|
||||
def __init__(self, seq) -> None: ...
|
||||
def prepare(self, conn) -> None: ...
|
||||
def getquoted(self): ...
|
||||
|
||||
class NoneAdapter:
|
||||
def __init__(self, obj) -> None: ...
|
||||
def getquoted(self, _null: bytes = b"NULL"): ...
|
||||
|
||||
def make_dsn(dsn: Incomplete | None = None, **kwargs): ...
|
||||
|
||||
JSON: Any
|
||||
JSONARRAY: Any
|
||||
JSONB: Any
|
||||
JSONBARRAY: Any
|
||||
|
||||
def adapt(obj: Any) -> ISQLQuote: ...
|
||||
@@ -0,0 +1,240 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections import OrderedDict
|
||||
from collections.abc import Callable
|
||||
from typing import Any, NamedTuple, TypeVar, overload
|
||||
|
||||
from psycopg2._ipaddress import register_ipaddress as register_ipaddress
|
||||
from psycopg2._json import (
|
||||
Json as Json,
|
||||
register_default_json as register_default_json,
|
||||
register_default_jsonb as register_default_jsonb,
|
||||
register_json as register_json,
|
||||
)
|
||||
from psycopg2._psycopg import (
|
||||
REPLICATION_LOGICAL as REPLICATION_LOGICAL,
|
||||
REPLICATION_PHYSICAL as REPLICATION_PHYSICAL,
|
||||
ReplicationConnection as _replicationConnection,
|
||||
ReplicationCursor as _replicationCursor,
|
||||
ReplicationMessage as ReplicationMessage,
|
||||
)
|
||||
from psycopg2._range import (
|
||||
DateRange as DateRange,
|
||||
DateTimeRange as DateTimeRange,
|
||||
DateTimeTZRange as DateTimeTZRange,
|
||||
NumericRange as NumericRange,
|
||||
Range as Range,
|
||||
RangeAdapter as RangeAdapter,
|
||||
RangeCaster as RangeCaster,
|
||||
register_range as register_range,
|
||||
)
|
||||
|
||||
from .extensions import connection as _connection, cursor as _cursor, quote_ident as quote_ident
|
||||
|
||||
_T_cur = TypeVar("_T_cur", bound=_cursor)
|
||||
|
||||
class DictCursorBase(_cursor):
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
|
||||
class DictConnection(_connection):
|
||||
@overload
|
||||
def cursor(self, name: str | bytes | None = ..., *, withhold: bool = ..., scrollable: bool | None = ...) -> DictCursor: ...
|
||||
@overload
|
||||
def cursor(
|
||||
self,
|
||||
name: str | bytes | None = ...,
|
||||
*,
|
||||
cursor_factory: Callable[..., _T_cur],
|
||||
withhold: bool = ...,
|
||||
scrollable: bool | None = ...,
|
||||
) -> _T_cur: ...
|
||||
@overload
|
||||
def cursor(
|
||||
self, name: str | bytes | None, cursor_factory: Callable[..., _T_cur], withhold: bool = ..., scrollable: bool | None = ...
|
||||
) -> _T_cur: ...
|
||||
|
||||
class DictCursor(DictCursorBase):
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
index: Any
|
||||
def execute(self, query, vars: Incomplete | None = None): ...
|
||||
def callproc(self, procname, vars: Incomplete | None = None): ...
|
||||
def fetchone(self) -> DictRow | None: ... # type: ignore[override]
|
||||
def fetchmany(self, size: int | None = None) -> list[DictRow]: ... # type: ignore[override]
|
||||
def fetchall(self) -> list[DictRow]: ... # type: ignore[override]
|
||||
def __next__(self) -> DictRow: ... # type: ignore[override]
|
||||
|
||||
class DictRow(list[Any]):
|
||||
def __init__(self, cursor) -> None: ...
|
||||
def __getitem__(self, x): ...
|
||||
def __setitem__(self, x, v) -> None: ...
|
||||
def items(self): ...
|
||||
def keys(self): ...
|
||||
def values(self): ...
|
||||
def get(self, x, default: Incomplete | None = None): ...
|
||||
def copy(self): ...
|
||||
def __contains__(self, x): ...
|
||||
def __reduce__(self): ...
|
||||
|
||||
class RealDictConnection(_connection):
|
||||
@overload
|
||||
def cursor(
|
||||
self, name: str | bytes | None = ..., *, withhold: bool = ..., scrollable: bool | None = ...
|
||||
) -> RealDictCursor: ...
|
||||
@overload
|
||||
def cursor(
|
||||
self,
|
||||
name: str | bytes | None = ...,
|
||||
*,
|
||||
cursor_factory: Callable[..., _T_cur],
|
||||
withhold: bool = ...,
|
||||
scrollable: bool | None = ...,
|
||||
) -> _T_cur: ...
|
||||
@overload
|
||||
def cursor(
|
||||
self, name: str | bytes | None, cursor_factory: Callable[..., _T_cur], withhold: bool = ..., scrollable: bool | None = ...
|
||||
) -> _T_cur: ...
|
||||
|
||||
class RealDictCursor(DictCursorBase):
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
column_mapping: Any
|
||||
def execute(self, query, vars: Incomplete | None = None): ...
|
||||
def callproc(self, procname, vars: Incomplete | None = None): ...
|
||||
def fetchone(self) -> RealDictRow | None: ... # type: ignore[override]
|
||||
def fetchmany(self, size: int | None = None) -> list[RealDictRow]: ... # type: ignore[override]
|
||||
def fetchall(self) -> list[RealDictRow]: ... # type: ignore[override]
|
||||
def __next__(self) -> RealDictRow: ... # type: ignore[override]
|
||||
|
||||
class RealDictRow(OrderedDict[Any, Any]):
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
def __setitem__(self, key, value) -> None: ...
|
||||
|
||||
class NamedTupleConnection(_connection):
|
||||
@overload
|
||||
def cursor(
|
||||
self, name: str | bytes | None = ..., *, withhold: bool = ..., scrollable: bool | None = ...
|
||||
) -> NamedTupleCursor: ...
|
||||
@overload
|
||||
def cursor(
|
||||
self,
|
||||
name: str | bytes | None = ...,
|
||||
*,
|
||||
cursor_factory: Callable[..., _T_cur],
|
||||
withhold: bool = ...,
|
||||
scrollable: bool | None = ...,
|
||||
) -> _T_cur: ...
|
||||
@overload
|
||||
def cursor(
|
||||
self, name: str | bytes | None, cursor_factory: Callable[..., _T_cur], withhold: bool = ..., scrollable: bool | None = ...
|
||||
) -> _T_cur: ...
|
||||
|
||||
class NamedTupleCursor(_cursor):
|
||||
Record: Any
|
||||
MAX_CACHE: int
|
||||
def execute(self, query, vars: Incomplete | None = None): ...
|
||||
def executemany(self, query, vars): ...
|
||||
def callproc(self, procname, vars: Incomplete | None = None): ...
|
||||
def fetchone(self) -> NamedTuple | None: ...
|
||||
def fetchmany(self, size: int | None = None) -> list[NamedTuple]: ... # type: ignore[override]
|
||||
def fetchall(self) -> list[NamedTuple]: ... # type: ignore[override]
|
||||
def __next__(self) -> NamedTuple: ...
|
||||
|
||||
class LoggingConnection(_connection):
|
||||
log: Any
|
||||
def initialize(self, logobj) -> None: ...
|
||||
def filter(self, msg, curs): ...
|
||||
def cursor(self, *args, **kwargs): ...
|
||||
|
||||
class LoggingCursor(_cursor):
|
||||
def execute(self, query, vars: Incomplete | None = None): ...
|
||||
def callproc(self, procname, vars: Incomplete | None = None): ...
|
||||
|
||||
class MinTimeLoggingConnection(LoggingConnection):
|
||||
def initialize(self, logobj, mintime: int = 0) -> None: ...
|
||||
def filter(self, msg, curs): ...
|
||||
def cursor(self, *args, **kwargs): ...
|
||||
|
||||
class MinTimeLoggingCursor(LoggingCursor):
|
||||
timestamp: Any
|
||||
def execute(self, query, vars: Incomplete | None = None): ...
|
||||
def callproc(self, procname, vars: Incomplete | None = None): ...
|
||||
|
||||
class LogicalReplicationConnection(_replicationConnection):
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
|
||||
class PhysicalReplicationConnection(_replicationConnection):
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
|
||||
class StopReplication(Exception): ...
|
||||
|
||||
class ReplicationCursor(_replicationCursor):
|
||||
def create_replication_slot(
|
||||
self, slot_name, slot_type: Incomplete | None = None, output_plugin: Incomplete | None = None
|
||||
) -> None: ...
|
||||
def drop_replication_slot(self, slot_name) -> None: ...
|
||||
def start_replication(
|
||||
self,
|
||||
slot_name: Incomplete | None = None,
|
||||
slot_type: Incomplete | None = None,
|
||||
start_lsn: int = 0,
|
||||
timeline: int = 0,
|
||||
options: Incomplete | None = None,
|
||||
decode: bool = False,
|
||||
status_interval: int = 10,
|
||||
) -> None: ...
|
||||
def fileno(self): ...
|
||||
|
||||
class UUID_adapter:
|
||||
def __init__(self, uuid) -> None: ...
|
||||
def __conform__(self, proto): ...
|
||||
def getquoted(self): ...
|
||||
|
||||
def register_uuid(oids: Incomplete | None = None, conn_or_curs: Incomplete | None = None): ...
|
||||
|
||||
class Inet:
|
||||
addr: Any
|
||||
def __init__(self, addr) -> None: ...
|
||||
def prepare(self, conn) -> None: ...
|
||||
def getquoted(self): ...
|
||||
def __conform__(self, proto): ...
|
||||
|
||||
def register_inet(oid: Incomplete | None = None, conn_or_curs: Incomplete | None = None): ...
|
||||
def wait_select(conn) -> None: ...
|
||||
|
||||
class HstoreAdapter:
|
||||
wrapped: Any
|
||||
def __init__(self, wrapped) -> None: ...
|
||||
conn: Any
|
||||
getquoted: Any
|
||||
def prepare(self, conn) -> None: ...
|
||||
@classmethod
|
||||
def parse(cls, s, cur, _bsdec=...): ...
|
||||
@classmethod
|
||||
def parse_unicode(cls, s, cur): ...
|
||||
@classmethod
|
||||
def get_oids(cls, conn_or_curs): ...
|
||||
|
||||
def register_hstore(
|
||||
conn_or_curs,
|
||||
globally: bool = False,
|
||||
unicode: bool = False,
|
||||
oid: Incomplete | None = None,
|
||||
array_oid: Incomplete | None = None,
|
||||
) -> None: ...
|
||||
|
||||
class CompositeCaster:
|
||||
name: Any
|
||||
schema: Any
|
||||
oid: Any
|
||||
array_oid: Any
|
||||
attnames: Any
|
||||
atttypes: Any
|
||||
typecaster: Any
|
||||
array_typecaster: Any
|
||||
def __init__(self, name, oid, attrs, array_oid: Incomplete | None = None, schema: Incomplete | None = None) -> None: ...
|
||||
def parse(self, s, curs): ...
|
||||
def make(self, values): ...
|
||||
@classmethod
|
||||
def tokenize(cls, s): ...
|
||||
|
||||
def register_composite(name, conn_or_curs, globally: bool = False, factory: Incomplete | None = None): ...
|
||||
def execute_batch(cur, sql, argslist, page_size: int = 100) -> None: ...
|
||||
def execute_values(cur, sql, argslist, template: Incomplete | None = None, page_size: int = 100, fetch: bool = False): ...
|
||||
@@ -0,0 +1,24 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import Any
|
||||
|
||||
import psycopg2
|
||||
|
||||
class PoolError(psycopg2.Error): ...
|
||||
|
||||
class AbstractConnectionPool:
|
||||
minconn: Any
|
||||
maxconn: Any
|
||||
closed: bool
|
||||
def __init__(self, minconn, maxconn, *args, **kwargs) -> None: ...
|
||||
# getconn, putconn and closeall are officially documented as methods of the
|
||||
# abstract base class, but in reality, they only exist on the children classes
|
||||
def getconn(self, key: Incomplete | None = ...): ...
|
||||
def putconn(self, conn: Any, key: Incomplete | None = ..., close: bool = ...) -> None: ...
|
||||
def closeall(self) -> None: ...
|
||||
|
||||
class SimpleConnectionPool(AbstractConnectionPool): ...
|
||||
|
||||
class ThreadedConnectionPool(AbstractConnectionPool):
|
||||
# This subclass has a default value for conn which doesn't exist
|
||||
# in the SimpleConnectionPool class, nor in the documentation
|
||||
def putconn(self, conn: Incomplete | None = None, key: Incomplete | None = None, close: bool = False) -> None: ...
|
||||
@@ -0,0 +1,50 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Iterator
|
||||
from typing import Any
|
||||
|
||||
class Composable:
|
||||
def __init__(self, wrapped) -> None: ...
|
||||
def as_string(self, context) -> str: ...
|
||||
def __add__(self, other) -> Composed: ...
|
||||
def __mul__(self, n) -> Composed: ...
|
||||
def __eq__(self, other) -> bool: ...
|
||||
def __ne__(self, other) -> bool: ...
|
||||
|
||||
class Composed(Composable):
|
||||
def __init__(self, seq) -> None: ...
|
||||
@property
|
||||
def seq(self) -> list[Composable]: ...
|
||||
def as_string(self, context) -> str: ...
|
||||
def __iter__(self) -> Iterator[Composable]: ...
|
||||
def __add__(self, other) -> Composed: ...
|
||||
def join(self, joiner) -> Composed: ...
|
||||
|
||||
class SQL(Composable):
|
||||
def __init__(self, string) -> None: ...
|
||||
@property
|
||||
def string(self) -> str: ...
|
||||
def as_string(self, context) -> str: ...
|
||||
def format(self, *args, **kwargs) -> Composed: ...
|
||||
def join(self, seq) -> Composed: ...
|
||||
|
||||
class Identifier(Composable):
|
||||
def __init__(self, *strings) -> None: ...
|
||||
@property
|
||||
def strings(self) -> tuple[str, ...]: ...
|
||||
@property
|
||||
def string(self) -> str: ...
|
||||
def as_string(self, context) -> str: ...
|
||||
|
||||
class Literal(Composable):
|
||||
@property
|
||||
def wrapped(self): ...
|
||||
def as_string(self, context) -> str: ...
|
||||
|
||||
class Placeholder(Composable):
|
||||
def __init__(self, name: Incomplete | None = None) -> None: ...
|
||||
@property
|
||||
def name(self) -> str | None: ...
|
||||
def as_string(self, context) -> str: ...
|
||||
|
||||
NULL: Any
|
||||
DEFAULT: Any
|
||||
@@ -0,0 +1,26 @@
|
||||
import datetime
|
||||
from _typeshed import Incomplete
|
||||
from typing import Any
|
||||
|
||||
ZERO: Any
|
||||
|
||||
class FixedOffsetTimezone(datetime.tzinfo):
|
||||
def __init__(self, offset: Incomplete | None = None, name: Incomplete | None = None) -> None: ...
|
||||
def __new__(cls, offset: Incomplete | None = None, name: Incomplete | None = None): ...
|
||||
def __eq__(self, other): ...
|
||||
def __ne__(self, other): ...
|
||||
def __getinitargs__(self): ...
|
||||
def utcoffset(self, dt): ...
|
||||
def tzname(self, dt): ...
|
||||
def dst(self, dt): ...
|
||||
|
||||
STDOFFSET: Any
|
||||
DSTOFFSET: Any
|
||||
DSTDIFF: Any
|
||||
|
||||
class LocalTimezone(datetime.tzinfo):
|
||||
def utcoffset(self, dt): ...
|
||||
def dst(self, dt): ...
|
||||
def tzname(self, dt): ...
|
||||
|
||||
LOCAL: Any
|
||||
@@ -0,0 +1,2 @@
|
||||
from .syncobj import FAIL_REASON, SyncObj, SyncObjConf, replicated
|
||||
__all__ = ['SyncObj', 'SyncObjConf', 'replicated', 'FAIL_REASON']
|
||||
@@ -0,0 +1,13 @@
|
||||
from typing import Optional
|
||||
class FAIL_REASON:
|
||||
SUCCESS = ...
|
||||
QUEUE_FULL = ...
|
||||
MISSING_LEADER = ...
|
||||
DISCARDED = ...
|
||||
NOT_LEADER = ...
|
||||
LEADER_CHANGED = ...
|
||||
REQUEST_DENIED = ...
|
||||
class SyncObjConf:
|
||||
password: Optional[str]
|
||||
autoTickPeriod: int
|
||||
def __init__(self, **kwargs) -> None: ...
|
||||
@@ -0,0 +1,5 @@
|
||||
from typing import Optional
|
||||
class DnsCachingResolver:
|
||||
def setTimeouts(self, cacheTime: float, failCacheTime: float) -> None: ...
|
||||
def resolve(self, hostname: str) -> Optional[str]: ...
|
||||
def globalDnsResolver() -> DnsCachingResolver: ...
|
||||
@@ -0,0 +1,6 @@
|
||||
class Node:
|
||||
@property
|
||||
def id(self) -> str: ...
|
||||
class TCPNode(Node):
|
||||
@property
|
||||
def host(self) -> str: ...
|
||||
@@ -0,0 +1,24 @@
|
||||
from typing import Any, Callable, Collection, List, Optional, Set, Type
|
||||
from .config import FAIL_REASON, SyncObjConf
|
||||
from .node import Node
|
||||
from .transport import Transport
|
||||
__all__ = ['FAIL_REASON', 'SyncObj', 'SyncObjConf', 'replicated']
|
||||
class SyncObj:
|
||||
def __init__(self, selfNode: Optional[str], otherNodes: Collection[str], conf: SyncObjConf=..., consumers=..., nodeClass=..., transport=..., transportClass: Type[Transport]=...) -> None: ...
|
||||
def destroy(self) -> None: ...
|
||||
def doTick(self, timeToWait: float = 0.0) -> None: ...
|
||||
def isNodeConnected(self, node: Node) -> bool: ...
|
||||
@property
|
||||
def selfNode(self) -> Node: ...
|
||||
@property
|
||||
def otherNodes(self) -> Set[Node]: ...
|
||||
@property
|
||||
def raftLastApplied(self) -> int: ...
|
||||
@property
|
||||
def raftCommitIndex(self) -> int: ...
|
||||
@property
|
||||
def conf(self) -> SyncObjConf: ...
|
||||
def _getLeader(self) -> Optional[Node]: ...
|
||||
def _isLeader(self) -> bool: ...
|
||||
def _onTick(self, timeToWait: float = 0.0) -> None: ...
|
||||
def replicated(*decArgs: Any, **decKwargs: Any) -> Callable[..., Any]: ...
|
||||
@@ -0,0 +1,4 @@
|
||||
class CONNECTION_STATE:
|
||||
DISCONNECTED = ...
|
||||
CONNECTING = ...
|
||||
CONNECTED = ...
|
||||
@@ -0,0 +1,10 @@
|
||||
from typing import Any, Callable, Collection, Optional
|
||||
from .node import TCPNode
|
||||
from .syncobj import SyncObj
|
||||
from .tcp_connection import CONNECTION_STATE
|
||||
__all__ = ['CONNECTION_STATE', 'TCPTransport']
|
||||
class Transport:
|
||||
def setOnUtilityMessageCallback(self, message: str, callback: Callable[[Any, Callable[..., Any]], Any]) -> None: ...
|
||||
class TCPTransport(Transport):
|
||||
def __init__(self, syncObj: SyncObj, selfNode: Optional[TCPNode], otherNodes: Collection[TCPNode]) -> None: ...
|
||||
def _connectIfNecessarySingle(self, node: TCPNode) -> bool: ...
|
||||
@@ -0,0 +1,5 @@
|
||||
from typing import Any, List, Optional, Union
|
||||
from .node import TCPNode
|
||||
class TcpUtility(Utility):
|
||||
def __init__(self, password: Optional[str] = None, timeout: float=900.0) -> None: ...
|
||||
def executeCommand(self, node: Union[str, TCPNode], command: List[Any]) -> Any: ...
|
||||
@@ -0,0 +1,6 @@
|
||||
from .poolmanager import PoolManager
|
||||
from .response import HTTPResponse
|
||||
from .util.request import make_headers
|
||||
from .util.timeout import Timeout
|
||||
|
||||
__all__ = ['HTTPResponse', 'PoolManager', 'Timeout', 'make_headers']
|
||||
@@ -0,0 +1,28 @@
|
||||
from typing import Any
|
||||
class HTTPHeaderDict(MutableMapping[str, str]):
|
||||
def __init__(self, headers=None, **kwargs) -> None: ...
|
||||
def __setitem__(self, key, val) -> None: ...
|
||||
def __getitem__(self, key): ...
|
||||
def __delitem__(self, key) -> None: ...
|
||||
def __contains__(self, key): ...
|
||||
def __eq__(self, other): ...
|
||||
def __iter__(self) -> NoReturn: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __ne__(self, other): ...
|
||||
values: Any
|
||||
get: Any
|
||||
update: Any
|
||||
iterkeys: Any
|
||||
itervalues: Any
|
||||
def pop(self, key, default=...): ...
|
||||
def discard(self, key): ...
|
||||
def add(self, key, val): ...
|
||||
def extend(self, *args, **kwargs): ...
|
||||
def getlist(self, key): ...
|
||||
getheaders: Any
|
||||
getallmatchingheaders: Any
|
||||
iget: Any
|
||||
def copy(self): ...
|
||||
def iteritems(self): ...
|
||||
def itermerged(self): ...
|
||||
def items(self): ...
|
||||
@@ -0,0 +1,2 @@
|
||||
from http.client import HTTPConnection as _HTTPConnection
|
||||
class HTTPConnection(_HTTPConnection): ...
|
||||
@@ -0,0 +1,9 @@
|
||||
from typing import Any, Dict, Optional
|
||||
from .response import HTTPResponse
|
||||
class PoolManager:
|
||||
headers: Dict[str, str]
|
||||
connection_pool_kw: Dict[str, Any]
|
||||
def __init__(self, num_pools: int = 10, headers: Optional[Dict[str, str]] = None, **connection_pool_kw: Any) -> None: ...
|
||||
def urlopen(self, method: str, url: str, body: Optional[Any] = None, headers: Optional[Dict[str,str]] = None, encode_multipart: bool = True, multipart_boundary: Optional[str] = None, **kw: Any) -> HTTPResponse: ...
|
||||
def request(self, method: str, url: str, fields: Optional[Any] = None, headers: Optional[Dict[str, str]] = None, **urlopen_kw: Any) -> HTTPResponse: ...
|
||||
def clear(self) -> None: ...
|
||||
@@ -0,0 +1,14 @@
|
||||
import io
|
||||
from typing import Any, Iterator, Optional, Union
|
||||
from ._collections import HTTPHeaderDict
|
||||
from .connection import HTTPConnection
|
||||
class HTTPResponse(io.IOBase):
|
||||
headers: HTTPHeaderDict
|
||||
status: int
|
||||
reason: Optional[str]
|
||||
def release_conn(self) -> None: ...
|
||||
@property
|
||||
def data(self) -> Union[bytes, Any]: ...
|
||||
@property
|
||||
def connection(self) -> Optional[HTTPConnection]: ...
|
||||
def read_chunked(self, amt: Optional[int] = None, decode_content: Optional[bool] = None) -> Iterator[bytes]: ...
|
||||
@@ -0,0 +1,9 @@
|
||||
from typing import Optional, Union, Dict, List
|
||||
def make_headers(
|
||||
keep_alive: Optional[bool] = None,
|
||||
accept_encoding: Union[bool, List[str], str, None] = None,
|
||||
user_agent: Optional[str] = None,
|
||||
basic_auth: Optional[str] = None,
|
||||
proxy_basic_auth: Optional[str] = None,
|
||||
disable_cache: Optional[bool] = None,
|
||||
) -> Dict[str, str]: ...
|
||||
@@ -0,0 +1,4 @@
|
||||
from typing import Any, Optional
|
||||
class Timeout:
|
||||
DEFAULT_TIMEOUT: Any
|
||||
def __init__(self, total: Optional[float] = None, connect: Optional[float] = None, read: Optional[float] = None) -> None: ...
|
||||
@@ -0,0 +1,5 @@
|
||||
import io
|
||||
from typing import Any
|
||||
class PatchStream:
|
||||
def __init__(self, diff_hdl: io.TextIOBase) -> None: ...
|
||||
def markup_to_pager(stream: Any, opts: Any) -> None: ...
|
||||
Reference in New Issue
Block a user