Boost logo

Boost :

Subject: Re: [boost] sqlpp11: SQL for C++
From: Larry Evans (cppljevans_at_[hidden])
Date: 2013-11-11 10:16:41


On 11/11/13 09:01, Roland Bock wrote:
> On 2013-11-11 15:36, Edward Diener wrote:
>> On 11/11/2013 7:53 AM, Roland Bock wrote:
[snip]
>>> Result rows are currently to be returned from the connector's result
>>> object as const char**, see database_api/api.h.
>>
>> You are kidding ? Is std::vector<std::string> too advanced ? Why C++
>> programmers are still using C null-terminated strings I will never
>> understand.
> No kidding. The database client libraries I've used so far are C
> libraries yielding char**. That is why the current connector interface
> also uses const char**. BTW: These are typically not null-terminated but
> are delivered with a size_t* or similar to inform about the length...
>
> But:
>
> 1. As a user of the library you don't get in touch with those. The
> members of a row are NOT char*, of course. You get integers as
> integers, floats as floats and of course you get text as
> std::string. I wouldn't dare to use char* there ;-)

Since the return values from the database are char**, these must be
parsed and converted into a vector of, for example, TabSample,
where TabSample is from:

   https://github.com/rbock/sqlpp11/blob/master/tests/TabSample.h

Sounds like a job for spirit. However, I guess this option was
rejected for reasons similar to why proto was rejected for
creating the sql string to the dbms, as expressed in your
reply to my other post:

http://article.gmane.org/gmane.comp.lib.boost.devel/246117

Is that right?

[snip]


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