Boost logo

Boost :

From: Jose (jmalv04_at_[hidden])
Date: 2005-10-04 14:30:45


On 10/4/05, Calum Grant <calum_at_[hidden]> wrote:
>
>
> > Yes. I was only wondering if it could be possible to map (at
> > compile time) a sql string like select name from people where
> > name ="Reece" ---> select(people,
> > col<person_name>() == "Reece");
> > so that the "library user" specifies standard sql syntax (I
> > am interested in using RML but am not an expert!)
>
> One could certainly map the other way, i.e. generate a SQL string from a
> C++ expression. So one could implement a function that could transform a
> RML expression to a SQL string, that could be passed to a database. The
> question is whether a C++-based syntax would be preferable to a
> string-based syntax.

 Probably the reverse mapping you mention is useful for compatibility with
rdbms engines.
 To me the string based syntax for queries is good because they would be
validated at compile time and the syntax is simple and very-well known (this
is a similar argument to the macro being good to keep the syntax easy).
 Now the alternatives would be "sql string" syntax and the template-based
one


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