Skip to content

Commit 68850b4

Browse files
committed
more fixes and fill in missing items
1 parent 9bc2e99 commit 68850b4

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

stubs/cysqlite/cysqlite/_cysqlite.pyi

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,20 @@ class Connection(_callable_context_manager):
163163
self, full: bool = False, truncate: bool = False, restart: bool = False, name: str | Buffer | None = None
164164
) -> tuple[int, int]: ...
165165
def close(self) -> bool: ...
166-
def commit(self, begin: bool = True): ...
166+
def commit(self, begin: bool = True) -> None: ...
167167
def commit_hook(self, fn: Callable[[], None]) -> None: ...
168168
def connect(self) -> bool: ...
169169
def converter(self, data_type: str) -> Callable[[Callable[_P, _T]], Callable[_P, _T]]: ...
170170
def create_aggregate(
171171
self, agg: Callable[..., Any], name: str | Buffer | None = None, nargs: int = -1, deterministic: bool = True
172172
) -> None: ...
173173
def create_collation(self, fn: Callable[[str, str], int], name: str | Buffer | None = None) -> None: ...
174-
def create_function(self, fn, name: str | Buffer | None = None, nargs: int = -1, deterministic: bool = True) -> None: ...
174+
def create_function(
175+
self, fn: Callable[..., Any], name: str | Buffer | None = None, nargs: int = -1, deterministic: bool = True
176+
) -> None: ...
175177
def create_window_function(
176178
self, agg: Callable[..., Any], name: str | Buffer | None = None, nargs: int = -1, deterministic: bool = True
177-
): ...
179+
) -> None: ...
178180
def cursor(self) -> Cursor: ...
179181
def database_list(self) -> list[tuple[str, str]]: ...
180182
def db_config(self, op: int, setting: int | None = None) -> int: ...
@@ -185,7 +187,7 @@ class Connection(_callable_context_manager):
185187
def execute_simple(self, sql: str, callback: Callable[..., Any] = ...) -> None: ...
186188
def executemany(self, sql: str, params: Sequence[_Parameters]) -> Cursor: ...
187189
def executescript(self, sql: str) -> Cursor: ...
188-
def file_control(self, op: int, val: int, name: str | Buffer | None = None): ...
190+
def file_control(self, op: int, val: int, name: str | Buffer | None = None) -> int: ...
189191
def finalize_statements(self) -> None: ...
190192
def get_columns(self) -> list[Column]: ...
191193
def get_foreign_keys(self, table: str, database: str | None = None) -> list[ForeignKey]: ...
@@ -315,11 +317,11 @@ class TableFunction:
315317
def get_table_columns_declaration(cls) -> str: ...
316318
@classmethod
317319
def register(cls, conn: Connection) -> None: ...
318-
def delete(self, rowid: int): ...
319-
def initialize(self, **filters): ...
320-
def insert(self, rowid: int, values: list[Any]): ...
320+
def delete(self, rowid: int) -> None: ...
321+
def initialize(self, **filters: Any) -> None: ...
322+
def insert(self, rowid: int, values: list[Any]) -> int: ...
321323
def iterate(self, idx: int) -> tuple[Any, ...]: ...
322-
def update(self, old_rowid: int, new_rowid: int, values: list[Any]): ...
324+
def update(self, old_rowid: int, new_rowid: int, values: list[Any]) -> None: ...
323325

324326
@disjoint_base
325327
class Transaction(_callable_context_manager):
@@ -340,7 +342,7 @@ class _callable_context_manager:
340342

341343
@disjoint_base
342344
class median:
343-
def __init__(self, *args) -> None: ...
345+
def __init__(self, *args: Any) -> None: ...
344346
def finalize(self) -> float: ...
345347
def inverse(self, item: float) -> None: ...
346348
def step(self, item: float) -> None: ...

stubs/cysqlite/cysqlite/aio.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class AsyncCursor:
9595
@property
9696
def rowcount(self) -> int: ...
9797
def __aiter__(self) -> Self: ...
98-
async def fetchmany(self, size: int = 100, constructor: type[Sequence[Row | Any]] = ...): ...
98+
async def fetchmany(self, size: int = 100, constructor: type[Sequence[Row | Any]] = ...) -> Sequence[Row | Any]: ...
9999
async def __anext__(self) -> Row | Any: ...
100100

101101
class _AsyncTransactionWrapper:

stubs/cysqlite/cysqlite/utils.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ from typing import Literal
22

33
from ._cysqlite import Connection
44

5-
def slow_query_log(conn: Connection, threshold_ms: int = 50, logger=None, level=30, expand_sql: bool = True) -> Literal[True]: ...
5+
def slow_query_log(
6+
conn: Connection, threshold_ms: int = 50, logger: str | None = None, level: int = 30, expand_sql: bool = True
7+
) -> Literal[True]: ...

0 commit comments

Comments
 (0)