Dear AutoIt + SQLite user,
I wrote this little function to benefit of the recently introduced SQLite backup API. "Recently" is somehow a distorsion of history, since its first appearance was in version 3.6.11.
Q) Is the thing easy to use?
A) Yes: there is only one call that takes care of everything (almost).
Q) Why should you use it, instead of simply copying the SQLite database file itself?
A) There are common siuations where you just can't do that. Either there are other uninterruptible processes using the database, or you managed to build a memory database but at some point decided that it would be wise to avoid loosing your work if ever your fine application crashes :ahem: a power loss occurs! In both cases, you have to be very, very careful duplicating your database as they are many potential pitfalls doing so.
Q) So it is possible to keep on reading the source database while it is being backed up?!?
Q) And it is possible to modify the source database during its backup?!?
A) Also correct, BUT each time the base is modified, the backup needs to restart, or write again a number of dirty pages. Thus, if you write at high rate to your source base, it's likely that the backup process will never complete.
Q) How should you use it?
A) Read the fine doc! No, seriously there is no proper documentation, just a short abstract.
Q) Is there a runable example to better understand how it works?
A) Yes, along the function itself, there is a usable example.
Please regard this as a beta: there may remain bugs in it and the interface may change in some future.
Don't rely on this for mission-critical data, you've been warned.
I'd like to receive your bug reports and suggestions.
2010-01-13 version 0.1
2010-03-14 version 0.2 changed return value to DB handle, so that the function can be used to load a disk-DB into memory
EDIT 18/06/2014: fixed new global variable name.
Little demo in pseudo-real situation:
EDIT: ignore the #include for helpers.au3 in the example.