ncruces / go-sqlite3

Go bindings to SQLite using wazero
https://pkg.go.dev/github.com/ncruces/go-sqlite3
MIT License
402 stars 12 forks source link

Should memdb shared instances be ref counted? #87

Closed ncruces closed 3 months ago

ncruces commented 4 months ago

Found a difference between our and SQLite's memdb VFS: theirs is reference counted.

When the last connection to a shared database is closed, it gets deleted. I'm wondering whether I want to implement this, as I chose not to in the past.

Creating a DB with memdb.Create(name, data) should add an additional reference, for a database that outlives any connections (until explicitly deleted).