Good afternoon list,

Is there any way to open a SQLite databases out of an in memory buffer
rather than an operating system file (via a VFS)?

The runtime environment of one of our platforms does not have local
storage that can be accessed via a normal operating system VFS but via
an interface that accesses very slow secure storage.  This interface
only supports passing files in and out via memory buffers and is
hideously slow.  On our other platforms we load our database into an
completely memory resident database (:memory:) from an database file on
read only storage which we attach to during start up and then detach
once we've finished copying our data into memory.  This approach has
worked quite well so far, as it avoids SQLite attempting to access
storage (which is read only) except during set-up.  So we would quite
like to keep using this approach if possible but are unsure about how to
solve this new problem with working with the buffers coming from or
going into secure storage.

One solution would seem to be to write a new VFS that handles this
reading and writing of memory buffers.  However writing a new VFS would
seem to be quite an time consuming solution, especially as current
solution of using :memory: databases seems to be working except for this
one issue.  It would seem the easier solution would be to copy the data
out of the buffer and into SQLite's memory pages when setting up and to
copy the data from SQLite to the buffer during shutdown but I am unsure
if this functionality already exists or if it does not exist how to
begin implementing it.

Any advice on potential solutions would be most welcome!

Cheers,

Daniel Brown | Software Engineer
"The best laid schemes o' mice an' men, gang aft agley"


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to