-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathlibsql_experimental.pyi
More file actions
69 lines (51 loc) · 2.19 KB
/
libsql_experimental.pyi
File metadata and controls
69 lines (51 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""libSQL's experimental Python implementation"""
from typing import Any, Self, final
paramstyle = "qmark"
sqlite_version_info = (3, 42, 0)
Error = Exception
LEGACY_TRANSACTION_CONTROL: int = -1
@final
class Cursor:
"""libSQL database cursor.
Implements a superset of the [DB-API 2.0 (PEP249)](https://peps.python.org/pep-0249/) Cursor object protocol.""" # noqa: E501
arraysize: int
@property
def description(self) -> tuple[tuple[Any, ...], ...] | None: ...
@property
def rowcount(self) -> int: ...
@property
def lastrowid(self) -> int | None: ...
def close(self) -> None: ...
def execute(self, sql: str, parameters: tuple[Any, ...] = ...) -> Self: ...
def executemany(self, sql: str, parameters: list[tuple[Any, ...]] = ...) -> Self: ... # noqa: E501
def executescript(self, script: str) -> Self: ...
def fetchone(self) -> tuple[Any, ...] | None: ...
def fetchmany(self, size: int = ...) -> list[tuple[Any, ...]]: ... # noqa: E501
def fetchall(self) -> list[tuple[Any, ...]]: ...
@final
class Connection:
"""libSQL database connection.
Implements a superset of the [DB-API 2.0 (PEP249)](https://peps.python.org/pep-0249/) Connection object protocol.""" # noqa: E501
@property
def isolation_level(self) -> str | None: ...
@property
def in_transaction(self) -> bool: ...
@property
def autocommit(self) -> int: ...
def commit(self) -> None: ...
def cursor(self) -> Cursor: ...
def sync(self) -> None: ...
def rollback(self) -> None: ...
def execute(self, sql: str, parameters: tuple[Any, ...] = ...) -> Cursor: ... # noqa: E501
def executemany(self, sql: str, parameters: list[tuple[Any, ...]] = ...) -> Cursor: ... # noqa: E501
def executescript(self, script: str) -> None: ...
def connect(database: str,
isolation_level: str | None = ...,
check_same_thread: bool = True,
uri: bool = False,
sync_url: str = ...,
sync_interval: float = ...,
auth_token: str = ...,
encryption_key: str = ...,
autocommit: int = ...) -> Connection:
"""Open a new libSQL connection, return a Connection object."""