Boost logo

Boost :

Subject: Re: [boost] Boost.SQL?
From: Roland Bock (rbock_at_[hidden])
Date: 2010-09-15 10:47:38

On 09/15/2010 03:43 PM, Maciej Sobczak wrote:
> Hi,
> On 9/15/2010 1:46 PM, Roland Bock wrote:
>> OK, taking the first example from the SOCI project page:
>> sql<< "select name, salary from persons where id ="<< id,
>> into(name), into(salary);
> [...]
>> This is nice, but still requires attention where the compiler could
>> help, if the table definition was known. Here is what it would look like
>> in my version (assuming that I manage the transition to boost proto):
> [...]
>> Maybe it would make sense to add such a layer as an option to SOCI?
> In all example programs SOCI takes the string as the query, but in
> fact it can be anything that is "streamable".
> This makes it possible to add any imaginable layer that will
> ultimately end up as an object that will produce the intended text
> query when streamed out.
> That is:
> into(name), into(salary);
I guess I could also wrap this

rowset<row> rs = (sql.prepare<< "select id, firstname, lastname, gender from person");

into something that immediately returns vector<smart_row> (or
boost::range, as proposed by Mathias). Since the "smart&static" engine
knows what it asks for, it can assign row[0] to, row[1] to
smart_row.firstname , etc.
The rowset and its iterators are rather similar to the stuff from
libpqxx which I currently use...

I'll have a closer look at the interface documentation, soon (struggling
with my first steps with Boost::Proto for the moment).



Boost list run by bdawes at, gregod at, cpdaniel at, john at