Closed dko-orion closed 1 month ago
Closing drift databases is a final operation, they can't be re-opened afterwards. This is by design - in some cases (like when talking to a database over the network, we'd have no good time point to actually close underlying resources if it's expected that users will just re-open the database after closing it).
The solution is to either not close the database (since you're still referencing it to reuse it afterwards, you're not really saving any memory). Or, if you still want to close it, you'll have to re-create a new instance of your database class - that one can then be used again of course.
I have in my part of my application I use LazyDatabase open connection like it shared in example. After my part (module) of application is finished I close database to release not needed resources for now and prevent memory leaks etc.
Then I can return to this part of application again and call open connection again with LazyDatabase and continue working with database. After all this done I'm getting error:
drift version 2.1.8 Dependency injection: Modular