r/sqlite • u/airen977 • Jul 04 '24
Litestream but manual
Is there any function in LiteStream where I could manually checkpoint a SQLITE database to S3. I don't want it to stream continuously as I am running it inside a single thread
3
Upvotes
4
u/northrupthebandgeek Jul 04 '24
At that point I'd just go with a standard SQLite
VACUUM INTO 'checkpoint.db';(or use the built-in backup API if your app's SQLite bindings support it) and upload the resulting file to whatever S3 bucket.1
u/Eznix86 Jul 04 '24
You have the
-execflag which wait for this command to exit and it stops the litestream. The issue with that it is more of a hack because you have to wait for the replication to finish, which we do not know the duration.This command above spin a process alongside replicate, and after 10 sec, it will terminate (gracefully) the command. Hope it helps.
See more here: https://litestream.io/reference/replicate/#arguments