Closed beldmian closed 1 month ago
The first question is: why would you want to do this? What actual problem are you're trying to solve by opening the file directly with the VFS?
VFSes are really meant to be called by SQLite, not by yourself. There's no harm in doing it, but if you are going to do it, you're going to need to understand what promises SQLite makes when it calls a VFS.
A little debugging would tell you need to pass more flags to Open
, because that's what SQLite does.
That won't fix anything though, because by the time you call Open
the file has been deleted.
So, what problem are you trying to solve?
As for why the database is deleted by then, shared memdb files are reference counted. When you close the last connection to one, it gets deleted.
If you want to work around that, you can explicitly call memdb.Create
.
While testing memdb VFS found some strange behaviour - for code:
There is an error with
fs.Open(...)
:Am I doing something wrong?