|
Boost : |
Subject: Re: [boost] sqlpp11: SQL for C++
From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2013-11-12 03:39:23
On Mon, Nov 11, 2013 at 9:31 PM, Roland Bock <rbock_at_[hidden]> wrote:
> > On 11/11/13 13:35, Abel Sinkovics wrote:
> >> There is a library (Metaparse) which supports creating a string-based
> >> interface for libraries which is processed at compile-time. It could be
> >> used to provide a string-based interface.
>
> Metaparse requires const char[N] arguments, right? That would be a
> rather atypical case for using a query interface, I'd say. Personally I
> have never used queries without variable parameters except in examples
> like the one above.
Do you mean that you "inline" the variable parameters values in the query
text as opposed to using "placeholders" which you later "bind" with actual
values?
If that's the case, that's a big no-no on some RDBMS's like Oracle for
performance reason (you need to reparse and replan, i.e, "recompile" the
query and find again the optimal query execution plan), w/o even getting
into SQL injections, etc... A SQL DB API w/o support for prepared queries
which you can reuse with different bind values would be ineffective IMHO.
Similarly, if you cannot bind array of values to limit round-trips to the
DB (if supported; SQLite has no array interface for example), you can never
achieve maximum possible performance.
My $0.02 :). --DD
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk