Boost logo

Boost :

From: Artyom Beilis (artyom.beilis_at_[hidden])
Date: 2024-03-26 18:32:19


Hello,

Few comments on the lib:

1. Documentation is far from sufficient and examples are not really clear
2. Transaction handling seems to be very simplistics.
    I suggest create transaction guard that it destructor would call
rollback unless committed
    See how I do it in cppdb: http://cppcms.com/sql/cppdb/transaction.html

    Basically
        cppdb::transaction guard(sql);
        sql << "UPDATE accounts SET amount=amount+? WHERE user=?" << amount
<< receiver << cppdb::exec;
        sql << "UPDATE accounts SET amount=amount-? WHERE user=?" << amount
<< sender << cppdb::exec;
       guard.commit();
    And if something happens the guard would call rollback automatically,
this is something that is required for any SQL library.
3. Error handling: how do you handle deadlocks/timeouts/SQLIGHT BUSY events?

It seems to have rather good potential.

On a side note: I'm the author of cppdb:
http://cppcms.com/sql/cppdb/index.html it supports sqlite, mysql, postgress
and ODBC/MSSQL
It developed it back than and it does quite a lot of good stuff including
caching prepared statements and many other goodies.

It is included in Debian and Ubuntu distributions.

Unfortunately I don't have much time to spend on it, it wasn't updated to
C++11 friendly interface, would you consider using it
as a base and extending it? It needs a more modern interface and many
updates. If you do I'll release it under Boost license as well

Best,
Artyom Beilis

On Fri, Mar 22, 2024 at 3:30 AM Klemens Morgenstern via Boost <
boost_at_[hidden]> wrote:

> A while back I asked about interest in a boost.sqlite library and got
> enough engagement that I think it's worth proposing.
>
> Hence I am seeking an endorsement and would like to see if someone
> wants to volunteer as review manager.
>
> Code: https://github.com/klemens-morgenstern/sqlite
> Docs: https://klemens.dev/sqlite/
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk