| This is strange on so many levels. SQLite does not even do network I/O. How does sharing a connection (and transaction scope) in an asyncio environment even work? Won’t you still need a connection per asyncio context? Does sqlite_open really take long compared to the inevitable contention for the write lock you’ll see when you have many concurrent contexts? Does sqlite_open even register in comparison with the overhead of the python interpreter? What is an asyncio SQLite connection anyways? Isn’t it just a regular one that gets hucked into a separate thread? |
If you're querying a multi-GB SQLite database there are things like per-connection caches that may benefit from a connection pool.
> What is an asyncio SQLite connection anyways? Isn’t it just a regular one that gets hucked into a separate thread?
Basically yes - aiosqlite works by opening each connection in a dedicated thread and then sending async queries to it and waiting for a response that gets sent to a Future.
https://github.com/omnilib/aiosqlite/blob/895fd9183b43cecce8...