What’s the easiest way to backup/restore sqlite memory database to file database in Qt.
What’s the easiest way to backup/restore sqlite memory database to file database in Qt
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you will need to work with SQLite directly to do this. SQLite has an Online Backup API, the first example is backing up an in-memory database to a file database, so it should be possible to do what you need to do.
To get a
sqlite3*database handle, get the driver (QSqlDatabase::driver) from the database then get the handle (QSqlDriver::handle). The example code in the Qt docs shows how to cast theQVariantinto asqlite3*handle.