Skip to content

Commit 8dfc2c3

Browse files
committed
Add async types to hdbcli
1 parent 7f3ec00 commit 8dfc2c3

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

stubs/hdbcli/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version = "2.25.*"
1+
version = "2.27.*"
22
# upstream_repository = closed-source

stubs/hdbcli/hdbcli/dbapi.pyi

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,50 @@ DATETIME: type[date | time | datetime]
141141
STRING = str
142142
BINARY = memoryview
143143
ROWID = int
144+
145+
class AsyncConnection(Connection):
146+
@classmethod
147+
async def create(
148+
cls,
149+
address: str = "",
150+
port: int = 0,
151+
user: str = "",
152+
password: str = "",
153+
autocommit: bool = True,
154+
packetsize: int | None = None,
155+
userkey: str | None = ...,
156+
*,
157+
sessionvariables: dict[str, str] | None = ...,
158+
forcebulkfetch: bool | None = ...,
159+
) -> Self: ...
160+
async def cancel(self) -> bool: ...
161+
async def close(self) -> None: ...
162+
async def commit(self) -> None: ...
163+
async def cursor(self) -> AsyncCursor: ...
164+
async def rollback(self) -> None: ...
165+
166+
class AsyncCursor(Cursor):
167+
async def callproc(self, procname: str, parameters: tuple[Any, ...] = ..., overview: bool = ...) -> tuple[Any, ...]: ...
168+
async def close(self) -> None: ...
169+
async def execute(self, operation: str, parameters: tuple[Any, ...] | None = ...) -> bool: ...
170+
async def executemany(self, operation: str, parameters: _Parameters = ..., batcherrors: bool = False) -> Any: ...
171+
async def executemanyprepared(self, parameters: _Parameters = ...) -> Any: ...
172+
async def executeprepared(self, parameters: _Parameters = ...) -> Any: ...
173+
async def fetchone(self, uselob: bool = ...) -> ResultRow | None: ...
174+
async def fetchall(self) -> list[ResultRow]: ...
175+
async def fetchmany(self, size: int | None = ...) -> list[ResultRow]: ...
176+
async def nextset(self) -> None: ...
177+
async def prepare(self, operation: str, newcursor: bool = ...) -> Any: ...
178+
async def scroll(self, value: int, mode: Literal["absolute", "relative"] = ...) -> None: ...
179+
async def __aenter__(self) -> Self: ...
180+
async def __aexit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ...
181+
182+
class AsyncLob(LOB):
183+
async def close(self) -> None: ...
184+
async def find(self, object: str, length: int, position: int = ...) -> int: ...
185+
async def read(self, size: int = ..., position: int = ...) -> str | bytes: ...
186+
async def write(self, object: str | bytes) -> int: ...
187+
188+
async_connect = AsyncConnection
189+
190+
def set_async_mode(enabled: bool = True) -> None: ...

0 commit comments

Comments
 (0)