I'm currently using an in-memory(https://www.sqlite.org/inmemorydb.html) database because I cannot guarantee write access.
But in order to save the database, how do I convert the in-memory database to a byte array and potentially save it to file later when I do have write access? Thanks!
The database is created like in the example:
rc = sqlite3_open("file::memory:", &db);
I want to take db
and save into a byte array. Then, save the byte array to a file. Then load from the file like normal:
int sqlite3_open_v2(filename_of_saved_db, ppDb, flags, zVfs);
(using c++, but examples in any other language should work as well i assume)