Closed protex closed 1 year ago
Hi @protex,
That's because a buffer is practically an in-memory database, and as documented here, in-memory databases neither support encryption nor decryption.
SQLite’s Virtual File System encryption can be supported only for ordinary file based databases, not for memory based databases
Closing the issue since this is expected behavior.
I've got an interesting situation where I have a "database" where the first
1024
bytes are used as a header for an application. So, the actual database starts at byte 1025. I would like to be able to load the database via a buffer so that I remove the extra bytes in memory before actually creating theDatabase
instance, but I'm not sure how to do this.I've manually removed the first 1024 bytes and verified that the database works correctly by doing this:
I get the expected return of
[ { name = "item" } ]
.I then try the following (load file into buffer, pass buffer into
Database
)I would have expected this to work properly, but instead I end up with an
SQLITE_NOTADB
error. Is there something special I need to do to that buffer to get this to work?