unstorage icon indicating copy to clipboard operation
unstorage copied to clipboard

SQL database driver `dispose` doesn't close the connection

Open mutewinter opened this issue 5 months ago • 0 comments

Environment

Any

Reproduction

  1. Create a storage using db0 and SQLite
  2. Call .dispose
  3. The db0 connect remains open

Describe the bug

There is no dispose method for the SQL driver, which means that the connection remains open even after calling .dispose on the storage.

The connection stays open, which means that for example on Windows you can't delete the database file.

Workaround

I'm currently working around this by keeping a weak map of database objects mapped to storages and then doing this manually.

mutewinter avatar Sep 21 '25 12:09 mutewinter