Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Special backup process for SQLite #22

Open
kennylajara opened this issue Jun 23, 2021 · 0 comments
Open

Special backup process for SQLite #22

kennylajara opened this issue Jun 23, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@kennylajara
Copy link
Owner

Is your feature request related to a problem? Please describe.
When creating a DB backup, if the DB is in use while copying the file(s), it is possible to compromise the accuracy of the copied database because the original backup can be modified while the file is still being copied.

Describe the solution you'd like
It is required to create an special implementation for DB. Each database will need it's own implementation but Feature Request is specific for SQLite.

Additional context
This can be done with the SQLite3 Python library with the following block code:

import sqlite3

def progress(status, remaining, total):
    print(f'Copied {total-remaining} of {total} pages...')

con = sqlite3.connect('existing_db.db')
bck = sqlite3.connect('backup.db')
with bck:
    con.backup(bck, pages=1, progress=progress)
bck.close()
con.close()
@kennylajara kennylajara added the enhancement New feature or request label Jun 23, 2021
@kennylajara kennylajara added the documentation Improvements or additions to documentation label Jul 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant