Same API, with await sprinkled on top
aiosqlite wraps the standard sqlite3 module so you can await every operation. Internally it pushes each call onto a single background thread per connection — the event loop is never blocked.
pip install aiosqliteThe shapes that matter:
aiosqlite.connect(path)— async context manager that yields a connection.conn.execute(sql, params)— returns an async cursor.await cursor.fetchone(),await cursor.fetchall().async for row in conn.execute(...)— streaming iteration.conn.row_factory = aiosqlite.Row— same dict-like rows as sync sqlite3.
Tip: Set the same PRAGMAs you set in sync sqlite3 — WAL, foreign_keys, busy_timeout. aiosqlite forwards them to the underlying connection unchanged.