Boost logo

Boost :

Subject: Re: [boost] Boost.SQL?
From: Maciej Sobczak (prog_at_[hidden])
Date: 2010-09-15 09:43:31


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);

The problem is that there is still no relation between the query
(however it is made) and the bound data. A little bit more work would be
needed to provide this level of integration, but it can be done with
relative ease.

Please read this part of the SOCI documentation to see where such ideas
might fit:

I think that the "core" interface is a proper level for this kind of


Maciej Sobczak * *

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