Closed Gazler closed 5 months ago
This is unfortunately an intentional issue. DBConnection
does connection pooling. When the connection is closed, the database is also closed by virtue of sqlite_close
.
There has been discussions of dropping DBConnection all together and just keeping one process and facilitating who can and cannot write https://github.com/elixir-sqlite/exqlite/issues/192. I have not had time to really dive deeper into this yet and would like to play with it.
perhaps it should be documented in the "limitations" section so users are aware of it.
Definitely. A PR would be useful for this. I've also listed some background info in #133 about why this has a separate adapter implementation than what is offered by ecto_sql
.
When using an in memory database, if the a process that performs a query crashes, then the database is destroyed.
This could potentially be avoided by isolating the process that performs the query from the calling process (e.g. using Task.Supervisor). If this behaviour is intentional, perhaps it should be documented in the "limitations" section so users are aware of it.
Here is a simple example to replicate this. You'll see that the second query fails as the database has been destroyed.