From the documentation it looks like this is not possible, but I want to be sure. Here's my use case:
I want an encrypted database. It should only be decrypted while it is in memory (while the program is running). The only way I can s开发者_JAVA技巧ee to do this would be to decrypt a file from disk before handing it off to SQLite. But I cannot find any way to give SQLite a pointer and say, "Here, this is a database." Nor can I find a way to serialize an in-memory database and then encrypt it before writing to disk. I assume the sqlite3_backup API would need an unencrypted database file?
I'm running on Android, so I'd like to use the built-in SQLite and I don't think it will be possible to install SQLite Encryption Extension (SEE). (Running on Android also means I don't have full access to the C++ API, but we can ignore that for now).
Since you can replace the functions sqlite uses to interact with the filesystem from the application using the sqlite_vfs_register method, it should be possible. I don't have experience with the encryption extension, but there is a chance that it uses this interface too, so it might be even possible to use it.
精彩评论