mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-07 05:54:02 +08:00
[sqlite3] Support Row type in row_factory and type connection attribute as well (#15073)
This commit is contained in:
@@ -222,6 +222,7 @@ _AdaptedInputData: TypeAlias = _SqliteData | Any
|
||||
_Parameters: TypeAlias = SupportsLenAndGetItem[_AdaptedInputData] | Mapping[str, _AdaptedInputData]
|
||||
# Controls the legacy transaction handling mode of sqlite3.
|
||||
_IsolationLevel: TypeAlias = Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None
|
||||
_RowFactoryOptions: TypeAlias = type[Row] | Callable[[Cursor, Row], object] | None
|
||||
|
||||
@type_check_only
|
||||
class _AnyParamWindowAggregateClass(Protocol):
|
||||
@@ -300,7 +301,7 @@ class Connection:
|
||||
def autocommit(self) -> int: ...
|
||||
@autocommit.setter
|
||||
def autocommit(self, val: int) -> None: ...
|
||||
row_factory: Any
|
||||
row_factory: _RowFactoryOptions
|
||||
text_factory: Any
|
||||
if sys.version_info >= (3, 12):
|
||||
def __init__(
|
||||
@@ -416,7 +417,7 @@ class Cursor:
|
||||
def description(self) -> tuple[tuple[str, None, None, None, None, None, None], ...] | MaybeNone: ...
|
||||
@property
|
||||
def lastrowid(self) -> int | None: ...
|
||||
row_factory: Callable[[Cursor, Row], object] | None
|
||||
row_factory: _RowFactoryOptions
|
||||
@property
|
||||
def rowcount(self) -> int: ...
|
||||
def __init__(self, cursor: Connection, /) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user