Boost logo

Boost :

Subject: Re: [boost] sqlpp11: SQL for C++
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2013-11-12 18:48:49


On 13/11/2013 02:17, Quoth Roland Bock:
> Thanks for the input. Prepared queries are in fact not supported. I'll
> read up on them and report back.

In SQL Server, queries are automatically "prepared" as long as you
execute the same SQL statement as previously (so the only variations are
in the parameter values).

Provided that you do value insertion via actual parameters (either named
or positional, depending on the target SQL dialect) and not via directly
inserting constants into the SQL query itself, it should be fairly
straightforward to extend to a dialect that requires explicit preparing;
you'd just need to provide a syntax that allows you to cache a query
object in a variable and then execute it multiple times with different
actual values. (Using parameters is also preferred over direct
insertion because it lessens the risk of script injection.)


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