Subject: Re: [boost] sqlpp11: SQL for C++
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2013-11-09 18:12:10
On 9 November 2013 22:58, Roland Bock <rbock_at_[hidden]> wrote:
> On 2013-11-09 23:03, Michael Marcin wrote:
>> On 11/9/2013 4:03 PM, Roland Bock wrote:
>>> Please let me know your questions/thoughts/suggestions/rants.
>>> Contributions welcome, of course :-)
>> Could you compare your library with SOCI?
> I consider SOCI to be a string and position based approach, meaning that
> you (as a library user) have to use strings to construct your queries
> and positions to extract results.
Yes, that's correct.
In fact, SQL commands play an important role as part of DBMS access
abstraction. SQL is a part of SOCI interface, by design.
> sqlpp11 takes care of this responsibility for you and gives you rows
> with appropriately named and typed member variables. It is much harder
> to use those the wrong way without the compiler yelling at you.
> sqlpp11 assumes that you know your tables at compile time. Thus you can
> declare types representing tables and columns with appropriate names and
> types. You can then construct SQL queries and analyze the results with
> the full armory of syntax and type checking that C++ and template meta
> programming have to offer.
Thank you for this clarification.
I think sqlpp11 is an extremely interesting exercise.
I have been considering to add non-string layer to SOCI directly based
on your idea, soon after I saw it some time ago in your initial experiments.
-- Mateusz Loskot, http://mateusz.loskot.net
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk