Re: [sqlite] sqlite3session_changeset API oddity
On 01/06/2014 03:40 PM, Simon Slavin wrote: On 6 Jan 2014, at 5:18am, Dan Kennedywrote: 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. Suppose, before I do the UNDO I make another changeset and do all the other things needed to make it start recording. Will that end up with the invert of the first changeset ? I think so, yes. Dan. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite3session_changeset API oddity
On 6 Jan 2014, at 5:18am, Dan Kennedywrote: > 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. Suppose, before I do the UNDO I make another changeset and do all the other things needed to make it start recording. Will that end up with the invert of the first changeset ? Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite3session_changeset API oddity
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, , ); rc = sqlite3changeset_invert(pnChangeset, ppChangeset, , ); 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 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 sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] sqlite3session_changeset API oddity
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, , ); rc = sqlite3changeset_invert(pnChangeset, ppChangeset, , ); 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 is always 0. Is this a bug or something not correctly documented? Please let me know. -- Marco Bambini http://www.sqlabs.com http://twitter.com/sqlabs http://instagram.com/sqlabs ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users