I use sqlite for local tests for cases where the live app has a 'neo-serverless' database. It is very, very fast so the tests run almost instantly.
I use sqlite for local tests for cases where the live app has a 'neo-serverless' database. It is very, very fast so the tests run almost instantly.
https://www.sqlite.org/backup.html
There's a ".backup" command:
* https://sqlite.org/cli.html#special_commands_to_sqlite3_dot_...
Alternatively, given that it's ACID, you could just take a snapshot of the file system/volume in question, and do a recovery on restore.
Edit: SQLite also has WAL files, so presumably one could just use tar/rsync to create the backup, and only the last file would be 'corrupted', so you'd lose the last (few) transaction(s):
Also I don't think any cloud provider/database provides an always up to date backup other than a standby replica (which isn't also a backup exactly).
Also, it's comparatively simpler than other DBMS's like Postgres or MySQL.
But I've been copying after taking a shared lock on the sqlite db and I think that's supported as mentioned on https://www.sqlite.org/backup.html.
The online backup API is nice but it has to be done in-process or through a dedicated application. While the lock and file copy is very easy to do using whatever shell the OS provides.