Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Database::backup() #211

Merged
merged 2 commits into from
Jul 9, 2019
Merged

Implement Database::backup() #211

merged 2 commits into from
Jul 9, 2019

Conversation

os12
Copy link
Contributor

@os12 os12 commented Jul 6, 2019

 - it is possible to easily backup/restore a live DB via the
   sqlite3_backup_init() API
   - https://www.sqlite.org/backup.html
   - https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupinit
@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 96.586% when pulling a58ba7d on os12:master into 3ba20a3 on SRombauts:master.

@SRombauts SRombauts self-assigned this Jul 7, 2019
@SRombauts
Copy link
Owner

Thanks a lot, I really like that you are making all these improvements! This one is even something I had implemented locally for one project, but never put int this wrapper.

I would suggest two changes though:

  1. I usually try to stick with the underlying SQLite API name, so in this case it should be simply called "backup()"
  2. The second parameter should be an enum, so it would be so much clearer at the call site without comments

If you agree to these I'll let you make the changes, but else QI am willing to merge this like that and improve on later myself

@os12
Copy link
Contributor Author

os12 commented Jul 9, 2019

I took the name and the API verbatim from the sample... but sure, tweaked the names as per your suggestion. That took about a minute :)

@SRombauts SRombauts changed the title Implement Database::loadOrSaveDb() Implement Database::backup() Jul 9, 2019
@SRombauts SRombauts merged commit 514d7d6 into SRombauts:master Jul 9, 2019
@SRombauts
Copy link
Owner

Thank you for your work, once again very appreciated!

I merged it into master and pushed a compilation fix for C++98, needed until we can start a new C+11 (or C++14) branch.

Cheers,
Sébastien

@os12
Copy link
Contributor Author

os12 commented Jul 9, 2019

Cool! Thanks for the fix Sébastien!

Now I need to decide whether I should rebase :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants