On 6 January 2013 00:58, Mateusz Loskot <[email protected]> wrote: > Folks, > > I've tried to pin down the problem revealed by test6 > in SQLite3 tests [1]. I have added comment [2] with further > explanation of my findings. > > It seems to be clear what needs to be done, but I'm not really > sure which of the two sequences represent desired behaviour > in SOCI in general. Here I copied the two versions from the comment: > > 1) > statement st1 = (sql.prepare << "update soci_test set val = val + 1"); > st1.execute(false); > st1.get_affected_rows() > > 2) > statement st1 = (sql.prepare << "update soci_test set val = val + 1"); > st1.execute(false); > st1.fetch(); > st1.get_affected_rows() > > I assume we all agree the get_affected_rows behaviour is > specific to DBMS backend and it is tricky to get it unified in > abstractions like SOCI. > > But, speaking of SOCI public interface, which of the sequence > we want to support, 1) or 2) or both? > I'd like to have such question answered before diving into reimplementing it. > > Please, feel free to brainstorm it here or comment the issue at GH. > > [1] > https://github.com/SOCI/soci/blob/master/src/backends/sqlite3/test/test-sqlite3.cpp > [2] https://github.com/SOCI/soci/issues/15#issuecomment-11922458
Folks, Sergei submitted pull request and proposed how to handle this situation in simple way, based on SQLite3: https://github.com/SOCI/soci/pull/58 I have adopted Sergei's idea by moving the test6 from test-sqlite3.cpp to common-tests.h, so it is checked across all the backends. I submitted this work as a new pull request (and commented and closed Sergei's pull): https://github.com/SOCI/soci/pull/59 I agree with this unification, but before I merge it into the master, I'd like to request for review and comments, in case there are any objections. Please, take a look at the detailed explanation in #59 Thanks to Sergei for his help! Best regards, -- Mateusz Loskot, http://mateusz.loskot.net ------------------------------------------------------------------------------ Free Next-Gen Firewall Hardware Offer Buy your Sophos next-gen firewall before the end March 2013 and get the hardware for free! Learn more. http://p.sf.net/sfu/sophos-d2d-feb _______________________________________________ soci-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/soci-users
