
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: sql << HERE-YOUR.SMART%STATIC|QUERY&MAKING*ENGINE, 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: http://soci.sourceforge.net/doc/interfaces.html I think that the "core" interface is a proper level for this kind of integration. Regards, -- Maciej Sobczak * www.msobczak.com * www.inspirel.com