Dear Purveyors and Artisans of MySQL++:
Recently we discussed the design and implementation of a new feature of
the mysqlpp::Query that allows for implementing bulk INSERT statements
while providing "policy" objects that help with composing the SQL
statements with respect to a maximum SQL query size, maximum number of
objects per insert or any other criterion a user could add himself.
I came up with a prototype that I think is a good design, but when I
tried it out I discovered the quoting wasn't right. It seems I need to
use the operator <<( ) method with a stream class (e.g., mysqlpp::Query)
for a SSQLS value_list in order to get quoting for the values that need
it. I had been passing the SSQLS objects to the InsertPolicy object and
having it append each value list on to the query, and providing the
means to check if a subsequent object can be added in.
Inside of my DefaultInsertPolicy I am making a VALUES section for each
object using the operator <<( ) function on the object's value_list and
a std::ostringstream private to the DefaultInsertPolicy object, thinking
the quoting would be applied just as it is when you do the same thing
with a mysqlpp::Query object (which is done in several places in
lib/query.h).
Can anyone explain what might be the problem? If more detail is needed
I can post the actual code I'm using.
Rick