sqlite_async.dart icon indicating copy to clipboard operation
sqlite_async.dart copied to clipboard

Obtain all active connections in the pool

Open js2702 opened this issue 5 months ago • 2 comments

We are currently in the process of testing PowerSync to migrate one of our apps. It makes heavy use of ATTACH/DETACH during runtime and we've been previously using just a single connection on a background isolate with Drift. So now with sqlite_async we have at least two connections. Making it harder to run the ATTACH when needed.

We were wondering how feasible it would be to add a way to obtain a list of connections so that we can run the ATTACH query on all instances.

One solution would be running the attach before using the attached db in a query, but on our app that would be unfeasible because the attach acts like a global state and all the app logic relies on that attachment existing.

Also, one of our attached databases is pretty large so ideally we would prefer to open the read connections only once and don't tear them down. Is that how it currently works, or are the read connections spawned/teared down dynamically?

js2702 avatar Sep 11 '24 11:09 js2702