{"repo":"purarue/sqlite_backup","free":true,"listed":false,"github":"https://github.com/purarue/sqlite_backup","clone":"git clone https://github.com/purarue/sqlite_backup.git","description":"a tool to snapshot sqlite databases you don't own","language":"Python","stars":25,"topics":["database","sqlite","sqlite3"],"license":"MIT","category":"databases-storage","readme_excerpt":"sqlite backup This exposes the python stdlib sqlite.backup function as a library, with a couple extra steps. The main purpose for writing this is to copy sqlite databases that you may not own -- perhaps it belongs to an application (e.g., your browser) and is locked since that's currently open, or the OS keeps it open while the computer is active (e.g. Mac with iMessage) Features - Has the option (true by default) to first safely copy the database from disk to a temporary directory, which is: - useful in case the source is in read-only mode (e.g. in some sort of docker container) - safer if you're especially worried about corrupting or losing data - Uses Cpython s Connection.backup, which directly uses the underlying Sqlite C code - Performs a wal checkpoint and sets journal mode=DELETE after copying to the destination, to remove the WAL (write-ahead log; temporary database file). Typically the WAL is removed when the database is closed, but particular builds of sqlite, the default sqlite installed on mac, or sqlite compiled with SQLITE DBCONFIG NO CKPT ON CLOSE enabled or SQLITE FCNTL PERSIST WAL may prevent that -- so the checkpoint exists to ensure there are no temporary files leftover In short, this prioritizes safety of the data over performance (temporarily copying data files to /tmp ) - because we often don't know what the application may be doing while we're copying underlying sqlite databases The initial backup function and some tests were extracted out of the karlic","default_branch":null,"files":null,"tree":[],"storefront":"/r/purarue","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/purarue/sqlite_backup/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}