litestream icon indicating copy to clipboard operation
litestream copied to clipboard

Programmatic Usage

Open alapidas opened this issue 2 years ago • 3 comments

I couldn't find an existing issue asking this - is there a way to consume this programmatically? On some app platforms, one can point to a code base and have it automatically built and deployed. In this case, you can't use litestream, but if you're writing a Go-based app then you could import it and do a restore on app startup, and run periodic backups in a goroutine.

As a workaround, one could build a docker image that had litestream in it, but it can be more attractive to use it in-process in the example above.

Apologies in advance if this is already addressed elsewhere.

alapidas avatar Oct 27 '22 01:10 alapidas

And I just discovered https://github.com/benbjohnson/litestream/issues/215

alapidas avatar Oct 27 '22 03:10 alapidas

I read through https://github.com/benbjohnson/litestream-library-example/blob/main/main.go and it's sort of complex - is there any interest in creating a friendlier API for this?

alapidas avatar Oct 27 '22 03:10 alapidas