Classes
AsyncCursor
6
▼
Async wrapper around ``sqlite3.Cursor``.
AsyncCursor
6
▼
Async wrapper aroundsqlite3.Cursor.
Methods
description
0
Any
▼
property
description
0
Any
▼
def description(self) -> Any
Returns
Any
rowcount
0
int
▼
property
rowcount
0
int
▼
def rowcount(self) -> int
Returns
int
fetchall
0
list[Any]
▼
async
fetchall
0
list[Any]
▼
async def fetchall(self) -> list[Any]
Returns
list[Any]
fetchone
0
Any
▼
async
fetchone
0
Any
▼
async def fetchone(self) -> Any
Returns
Any
fetchmany
1
list[Any]
▼
async
fetchmany
1
list[Any]
▼
async def fetchmany(self, size: int = 100) -> list[Any]
Parameters
| Name | Type | Description |
|---|---|---|
size |
— |
Default:100
|
Returns
list[Any]
Internal Methods 1 ▼
__init__
1
▼
__init__
1
▼
def __init__(self, cursor: sqlite3.Cursor) -> None
Parameters
| Name | Type | Description |
|---|---|---|
cursor |
— |
AsyncConnection
11
▼
Async wrapper around ``sqlite3.Connection``.
AsyncConnection
11
▼
Async wrapper aroundsqlite3.Connection.
Methods
row_factory
0
Any
▼
property
row_factory
0
Any
▼
def row_factory(self) -> Any
Returns
Any
autocommit
0
bool
▼
property
autocommit
0
bool
▼
def autocommit(self) -> bool
Returns
bool
row_factory
1
▼
row_factory
1
▼
def row_factory(self, factory: Any) -> None
Parameters
| Name | Type | Description |
|---|---|---|
factory |
— |
autocommit
1
▼
autocommit
1
▼
def autocommit(self, value: bool) -> None
Parameters
| Name | Type | Description |
|---|---|---|
value |
— |
execute
2
AsyncCursor
▼
async
execute
2
AsyncCursor
▼
async def execute(self, sql: str, params: Sequence[Any] = ()) -> AsyncCursor
Parameters
| Name | Type | Description |
|---|---|---|
sql |
— |
|
params |
— |
Default:()
|
Returns
AsyncCursor
executemany
2
AsyncCursor
▼
async
executemany
2
AsyncCursor
▼
async def executemany(self, sql: str, params_seq: Sequence[Sequence[Any]]) -> AsyncCursor
Parameters
| Name | Type | Description |
|---|---|---|
sql |
— |
|
params_seq |
— |
Returns
AsyncCursor
executescript
1
▼
Execute multiple SQL statements at once.
Useful for migrations with multiple s…
async
executescript
1
▼
async def executescript(self, sql: str) -> None
Execute multiple SQL statements at once.
Useful for migrations with multiple statements (CREATE + INDEX, etc.).
Note:executescriptimplicitly commits any pending transaction
before running, and does not honorautocommitmode.
Parameters
| Name | Type | Description |
|---|---|---|
sql |
— |
commit
0
▼
async
commit
0
▼
async def commit(self) -> None
rollback
0
▼
async
rollback
0
▼
async def rollback(self) -> None
close
0
▼
async
close
0
▼
async def close(self) -> None
Internal Methods 1 ▼
__init__
1
▼
__init__
1
▼
def __init__(self, conn: sqlite3.Connection) -> None
Parameters
| Name | Type | Description |
|---|---|---|
conn |
— |
Functions
connect
1
AsyncConnection
▼
Open an async SQLite connection.
Uses ``autocommit=True`` so individual statem…
async
connect
1
AsyncConnection
▼
async def connect(path: str) -> AsyncConnection
Open an async SQLite connection.
Usesautocommit=Trueso individual statements commit immediately.
Usescheck_same_thread=Falsefor safe use with anyio's thread pool.
Parameters
| Name | Type | Description |
|---|---|---|
path |
str |
Returns
AsyncConnection