I have a sqlite database which is opened in :memory: that needs to be streamed/serialized midway into another file.
For example:
// Some data
// more data
// SQLITE
// more data
// more data
What’s the best way to do this? One option would be to use the sqlite_backup code to write to a temporary file and then read the file back in and stream it out and then delete the temp file. This would be relatively easy to implement, but wouldn’t exactly be efficient.
The other option is to manually write out the data table by table, but that’s painful.
Is there another way to stream the database from memory directly? My filestreams use boost::iostreams::filtering_ostream as a base.
Thanks!
Also, if anyone has any usggestions for dealing with different versions where column names might be changed/added, etc, that would be great!
Yeah, I’m just going to serialize everything manually and regenerate the INSERT/CREATE statements when loading. Wish there was a better way though…