On 01/05/2014 11:23 PM, Marco Bambini wrote:
I am using sqlite3_changeset API to add undo/redo capabilities to an app.
I record sqlite operations and I store all of them in a sqlite3_session object.

When I need to UNDO an operation I simply do something like:
rc = sqlite3session_changeset(session, &pnChangeset, &ppChangeset);
rc = sqlite3changeset_invert(pnChangeset, ppChangeset, &pnInvertedChangeset, 
&ppInvertedChangeset);
rc = sqlite3changeset_apply (self.db, pnInvertedChangeset, ppInvertedChangeset, 
NULL, fConflict, NULL);

The problem is that I would like to reuse the same session object to perform 
the REDO operation but after executing the UNDO code above, when I call:
rc = sqlite3session_changeset(session, &pnChangeset, &ppChangeset);
pnChangeset is always 0.

sqlite3session_changeset() returns a blob containing the differences
between the current database and the database as it was when the
session object was first attached. After running "UNDO", there are
no differences. Hence the empty changeset.

Dan.



_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to