massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-pyright / node_modules / pyright / dist / typeshed-fallback / stubs / psycopg2 / psycopg2 / extras.pyi
1 from collections import OrderedDict
2 from typing import Any, List
3
4 from psycopg2._ipaddress import register_ipaddress as register_ipaddress
5 from psycopg2._json import (
6     Json as Json,
7     register_default_json as register_default_json,
8     register_default_jsonb as register_default_jsonb,
9     register_json as register_json,
10 )
11 from psycopg2._psycopg import (
12     REPLICATION_LOGICAL as REPLICATION_LOGICAL,
13     REPLICATION_PHYSICAL as REPLICATION_PHYSICAL,
14     ReplicationConnection as _replicationConnection,
15     ReplicationCursor as _replicationCursor,
16     ReplicationMessage as ReplicationMessage,
17 )
18 from psycopg2._range import (
19     DateRange as DateRange,
20     DateTimeRange as DateTimeRange,
21     DateTimeTZRange as DateTimeTZRange,
22     NumericRange as NumericRange,
23     Range as Range,
24     RangeAdapter as RangeAdapter,
25     RangeCaster as RangeCaster,
26     register_range as register_range,
27 )
28
29 from .extensions import connection as _connection, cursor as _cursor, quote_ident as quote_ident
30
31 class DictCursorBase(_cursor):
32     row_factory: Any
33     def __init__(self, *args, **kwargs) -> None: ...
34     def fetchone(self): ...
35     def fetchmany(self, size: Any | None = ...): ...
36     def fetchall(self): ...
37     def __iter__(self): ...
38
39 class DictConnection(_connection):
40     def cursor(self, *args, **kwargs): ...
41
42 class DictCursor(DictCursorBase):
43     def __init__(self, *args, **kwargs) -> None: ...
44     index: Any
45     def execute(self, query, vars: Any | None = ...): ...
46     def callproc(self, procname, vars: Any | None = ...): ...
47
48 class DictRow(List[Any]):
49     def __init__(self, cursor) -> None: ...
50     def __getitem__(self, x): ...
51     def __setitem__(self, x, v) -> None: ...
52     def items(self): ...
53     def keys(self): ...
54     def values(self): ...
55     def get(self, x, default: Any | None = ...): ...
56     def copy(self): ...
57     def __contains__(self, x): ...
58     def __reduce__(self): ...
59
60 class RealDictConnection(_connection):
61     def cursor(self, *args, **kwargs): ...
62
63 class RealDictCursor(DictCursorBase):
64     def __init__(self, *args, **kwargs) -> None: ...
65     column_mapping: Any
66     def execute(self, query, vars: Any | None = ...): ...
67     def callproc(self, procname, vars: Any | None = ...): ...
68
69 class RealDictRow(OrderedDict[Any, Any]):
70     def __init__(self, *args, **kwargs) -> None: ...
71     def __setitem__(self, key, value) -> None: ...
72
73 class NamedTupleConnection(_connection):
74     def cursor(self, *args, **kwargs): ...
75
76 class NamedTupleCursor(_cursor):
77     Record: Any
78     MAX_CACHE: int
79     def execute(self, query, vars: Any | None = ...): ...
80     def executemany(self, query, vars): ...
81     def callproc(self, procname, vars: Any | None = ...): ...
82     def fetchone(self): ...
83     def fetchmany(self, size: Any | None = ...): ...
84     def fetchall(self): ...
85     def __iter__(self): ...
86
87 class LoggingConnection(_connection):
88     log: Any
89     def initialize(self, logobj) -> None: ...
90     def filter(self, msg, curs): ...
91     def cursor(self, *args, **kwargs): ...
92
93 class LoggingCursor(_cursor):
94     def execute(self, query, vars: Any | None = ...): ...
95     def callproc(self, procname, vars: Any | None = ...): ...
96
97 class MinTimeLoggingConnection(LoggingConnection):
98     def initialize(self, logobj, mintime: int = ...) -> None: ...
99     def filter(self, msg, curs): ...
100     def cursor(self, *args, **kwargs): ...
101
102 class MinTimeLoggingCursor(LoggingCursor):
103     timestamp: Any
104     def execute(self, query, vars: Any | None = ...): ...
105     def callproc(self, procname, vars: Any | None = ...): ...
106
107 class LogicalReplicationConnection(_replicationConnection):
108     def __init__(self, *args, **kwargs) -> None: ...
109
110 class PhysicalReplicationConnection(_replicationConnection):
111     def __init__(self, *args, **kwargs) -> None: ...
112
113 class StopReplication(Exception): ...
114
115 class ReplicationCursor(_replicationCursor):
116     def create_replication_slot(self, slot_name, slot_type: Any | None = ..., output_plugin: Any | None = ...) -> None: ...
117     def drop_replication_slot(self, slot_name) -> None: ...
118     def start_replication(
119         self,
120         slot_name: Any | None = ...,
121         slot_type: Any | None = ...,
122         start_lsn: int = ...,
123         timeline: int = ...,
124         options: Any | None = ...,
125         decode: bool = ...,
126         status_interval: int = ...,
127     ) -> None: ...
128     def fileno(self): ...
129
130 class UUID_adapter:
131     def __init__(self, uuid) -> None: ...
132     def __conform__(self, proto): ...
133     def getquoted(self): ...
134
135 def register_uuid(oids: Any | None = ..., conn_or_curs: Any | None = ...): ...
136
137 class Inet:
138     addr: Any
139     def __init__(self, addr) -> None: ...
140     def prepare(self, conn) -> None: ...
141     def getquoted(self): ...
142     def __conform__(self, proto): ...
143
144 def register_inet(oid: Any | None = ..., conn_or_curs: Any | None = ...): ...
145 def wait_select(conn) -> None: ...
146
147 class HstoreAdapter:
148     wrapped: Any
149     def __init__(self, wrapped) -> None: ...
150     conn: Any
151     getquoted: Any
152     def prepare(self, conn) -> None: ...
153     @classmethod
154     def parse(cls, s, cur, _bsdec=...): ...
155     @classmethod
156     def parse_unicode(cls, s, cur): ...
157     @classmethod
158     def get_oids(cls, conn_or_curs): ...
159
160 def register_hstore(
161     conn_or_curs, globally: bool = ..., unicode: bool = ..., oid: Any | None = ..., array_oid: Any | None = ...
162 ) -> None: ...
163
164 class CompositeCaster:
165     name: Any
166     schema: Any
167     oid: Any
168     array_oid: Any
169     attnames: Any
170     atttypes: Any
171     typecaster: Any
172     array_typecaster: Any
173     def __init__(self, name, oid, attrs, array_oid: Any | None = ..., schema: Any | None = ...) -> None: ...
174     def parse(self, s, curs): ...
175     def make(self, values): ...
176     @classmethod
177     def tokenize(cls, s): ...
178
179 def register_composite(name, conn_or_curs, globally: bool = ..., factory: Any | None = ...): ...
180 def execute_batch(cur, sql, argslist, page_size: int = ...) -> None: ...
181 def execute_values(cur, sql, argslist, template: Any | None = ..., page_size: int = ..., fetch: bool = ...): ...