Cursor
- class rapsqlite.Cursor
Bases:
objectCursor for executing queries.
- __aiter__()
Return an awaitable, that resolves in asynchronous iterator.
- __anext__()
Return a value or raise StopAsyncIteration.
- arraysize
- close()
Close the cursor (Phase 3.9). Clears cached results and resets state.
- connection
- description
- fetchall()
Fetch all rows.
- fetchmany(size=None)
Fetch many rows with size-based slicing. Phase 2.2: Properly implements size parameter by fetching all results, caching them, and returning appropriate slices. When size is omitted, uses cursor.arraysize (default 1).
- fetchone()
Fetch one row.
- iter_chunk_size
aiosqlite uses iter_chunk_size on cursor; same as arraysize.
- lastrowid
- row_factory
- rowcount
The Cursor class provides a way to execute queries and fetch results.
Example
from rapsqlite import connect
async with connect("example.db") as conn:
cursor = conn.cursor()
await cursor.execute("SELECT * FROM users")
rows = await cursor.fetchall()