go-gorm / gorm

The fantastic ORM library for Golang, aims to be developer friendly
https://gorm.io
MIT License
37.02k stars 3.94k forks source link

How to close file handle on a local sqlite db? #7252

Open sawyersteven opened 4 weeks ago

sawyersteven commented 4 weeks ago

Your Question

I'm using Gorm to access a sqlite db from the local filesystem. I'm writing tests now that require me to create and delete this sqlite file. Gorm seems to keep an open file handle on the db until the application terminates, so it is not possible to delete the db in the test cleanup.

Gorm should be able to completely disconnect from a db.

The document you expected this should be explained

Expected answer