On 2018/05/08 11:32 AM, Rowan Worth wrote:
On 8 May 2018 at 17:22, R Smith <ryansmit...@gmail.com> wrote:

On 2018/05/08 9:37 AM, Donald Shepherd wrote:


It would actually be real nice if the backup API had a parameter or flag
like "sqlite3_lockduringbackup".

Not quite right. sqlite3_backup_step accepts a number of pages to be copied
by the current invocation. If you specify a negative number of pages,
sqlite3_backup_step will obtain a read lock and copy the entire database
before returning. So the "lock during backup" mode already exists - the
only way you get the backup restarting behaviour is if you ask
sqlite3_backup_step to copy a subset of the database.

Thank you for clarifying - but it is still my understanding that the DB is not locked (if only in WAL mode), so the backup API, even with -1, either must ignore changes, or restart. My proposed flag is to lock rather than restart or ignore.

That said, it's hardly important - can be accomplished in controlling software and only serves a small number of use cases - but the API is best placed to effect the request. Perhaps place it on the "nice-to-have-someday" TO-DO list.

Cheers,
Ryan

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to