2011/11/17 Mateusz Łoskot <[email protected]>:
> On 16 November 2011 20:51, Mika Fischer <[email protected]> wrote:
>>
>> I would like to implement get_affected_rows for the sqlite3 backend,
>> which currently always returns -1.
>> [...]
>
> p.s. If you use GitHub, you may prefer to fork SOCI upstream mirror
> https://github.com/SOCI/soci
> apply your changes, then send me pull request (my GitHub username: mloskot).
> Eventually, I push accepted patches to the official Git repo at SF.net.


Mika,

I have merged your changes at GitHub
(https://github.com/SOCI/soci/commit/0224539b5b2920c79b24294e396a6a51b29d7244)

Before pushing to upstream at SF.net, I wanted to test it:

        for (int i = 0; i != 10; i++)
        {
            sql << "insert into soci_test(val) values(:val)", use(i);
        }

        statement st1 = (sql.prepare <<
            "update soci_test set val = val + 1");
        st1.execute(false);
        std::cout << st1.get_affected_rows() << std::endl;

It prints1 instead of 10.

Do you get correct results?
Do you have any idea why?
Perhaps this feature requires some specific SQLite3 version or
special configuration for SQLite3 build, some pragmas, etc.

Best regards,,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to