[sqlite3] Support Row type in row_factory and type connection attribute as well (#15073)

This commit is contained in:
Ivan Gonzalez
2025-11-24 10:02:07 -06:00
committed by GitHub
parent c42613e4c4
commit fbcce8e4ec
+3 -2
View File
@@ -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: ...