Skip to content

Implement SQLite backups with the .backup command #592

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

Merged
merged 5 commits into from
Jul 27, 2025

Conversation

whileman133
Copy link
Contributor

Description

The SqliteCPConnector is unsafe to use when there are active connections to the SQLite3 database (see How To Corrupt An SQLite Database File at sqlite.org). This PR adds SqliteBackupConnector that uses the .backup command in SQLite to safely backup a SQLite3 database with active connections.

Checklist

Please update this checklist as you complete each item:

  • Tests have been developed for bug fixes or new functionality.
  • The changelog has been updated, if necessary.
  • Documentation has been updated, if necessary.
  • GitHub Issues closed by this PR have been linked.

By submitting this pull request I agree that all contributions comply with this project's open source license(s).

@codecov-commenter
Copy link

codecov-commenter commented Jul 23, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.29%. Comparing base (515a099) to head (76d164a).

Files with missing lines Patch % Lines
dbbackup/db/sqlite.py 84.21% 2 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #592      +/-   ##
==========================================
- Coverage   91.43%   91.29%   -0.15%     
==========================================
  Files          19       19              
  Lines         934      953      +19     
  Branches      138      139       +1     
==========================================
+ Hits          854      870      +16     
- Misses         44       46       +2     
- Partials       36       37       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

whileman133 and others added 2 commits July 27, 2025 15:30
@Archmonger Archmonger merged commit cddff70 into Archmonger:master Jul 27, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants