admin管理员组

文章数量:1122832

I have a SQLite database which I'm accessing via mattn/go-sqlite3. I want to perform a live snapshot of that database. The catch is that the backup must be saved to an io.Writer instance. Specifically, I am implementing the SaveSnapshot() function for a raft implementaiton.

I am trying to figure out if it is possible to use SQLite's online backup system to pipe to this Writer instance. Is there a special file or named pipe I can use as the output database?

More generally, I want to do an online snapshot and backup of my sqlite database. While SQLite has a backup system out of the box, I don't see how I can use it for a writer. I would be fine running a SELECT statement and copying data to my writer, but I am again not sure how to ensure I am seeing just a current snapshot of the data while allowing updates to happen while this is taking place.

本文标签: goBack up sqlite to ioWriterStack Overflow