On Wed, Mar 27, 2024 at 2:32 AM Artyom Beilis via Boost
Hello,
Few comments on the lib:
1. Documentation is far from sufficient and examples are not really clear
I have yet to see documentation of a boost library that people are happy with.
2. Transaction handling seems to be very simplistics.
The main reason here is that the sqlite api doesn't have any transaction handling either, it's just more sql queries. With boost.scope handwriting a guard is trivial - and you don't have the issue that you might potentially throw from a destructor.
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?
I don't. That's what the error_code overloads are for.
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
I think the generic sql client that could excite me would be an asio-based one. I don't think cppdb is a got fit there.
Best, Artyom Beilis
On Fri, Mar 22, 2024 at 3:30 AM Klemens Morgenstern via Boost < boost@lists.boost.org> 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
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost