PSA for anyone using <sqldelight-androidx-driver>:...
# squarelibraries
e
PSA for anyone using sqldelight-androidx-driver: I am strongly considering making the driver async (the underlying SQLite APIs are still blocking though). This will allow more efficient integration with the connection pool that I've added to it, as well as make it possible to handle all of the details about dispatching internally, so SQLDelight APIs can be used without worrying about what
CoroutineDispatcher
you are using. If you have any thoughts, questions, or concerns, please discuss here
g
Would it work with transactions though? I believe now it's the biggest issue, because it doesn't like when transaction switches dispatcher and hangs
e
Yes, there's a pending PR to SqlDelight which introduces a mechanism that allows async drivers to wrap the transaction in a
withContext
call. Then the driver does some coroutines magic (borrowed from Room) to ensure the whole transaction is run on a single thread from the dispatcher.
👍 2
👀 3