On Wed, May 4, 2016 at 1:26 PM, Dominique Devienne <ddevienne at gmail.com> wrote: > On Wed, May 4, 2016 at 1:22 PM, Dominique Devienne <ddevienne at gmail.com> > wrote: >> On Wed, May 4, 2016 at 1:13 PM, Rob Willett >> <rob.sqlite at robertwillett.com> wrote: >>> Thanks for the reply, >>> >>> Yes Example 2 in https://www.sqlite.org/backup.html is what we are talking >>> about. It was very slow to run for us. >> >> Then maybe https://www.sqlite.org/rbu.html is your last chance. > > Unless you invest into writing your own VFS, which is thus fully aware > of page writes > and can "tee" those to the actual file, but also queue the written > pages to be written > (or sent on network) to the backup destination. But an SQLite VFS is > tricky business... --DD
Yours would be similar to http://www.sqlite.org/src/doc/trunk/src/test_multiplex.c from http://www.sqlite.org/vfs.html, but not for splitting a file in pieces, but duplicating the file somewhere. Although I don't think a VFS is aware of transaction boundaries, so you wouldn't know when the backup copy is in a "consistent" state, unless you can interpret xUnlock and/or xSync as transactions, but that depends on pragmas too. Not easy, in all cases IMHO. --DD