List:MySQL++« Previous MessageNext Message »
From:Rick Gutleber Date:October 27 2008 7:27pm
Subject:Insert policy design question
View as plain text  
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

Thread
Insert policy design questionRick Gutleber27 Oct
Re: Insert policy design questionRick Gutleber27 Oct
  • Re: Insert policy design questionDrew M.27 Oct
    • Re: Insert policy design questionWarren Young27 Oct
      • Re: Insert policy design questionRick Gutleber28 Oct
        • Re: Insert policy design questionWarren Young28 Oct
          • Re: Insert policy design questionRick Gutleber28 Oct
            • Re: Insert policy design questionWarren Young28 Oct
              • Re: Insert policy design questionRick Gutleber28 Oct
                • Re: Insert policy design questionWarren Young28 Oct
                  • Re: Insert policy design questionRick Gutleber29 Oct
                    • SVN down?Rick Gutleber6 Nov
                      • Re: SVN down?Warren Young6 Nov
                  • Query::tellp( )Rick Gutleber29 Oct
                    • Re: Query::tellp( )Warren Young29 Oct
    • Re: Insert policy design questionRick Gutleber27 Oct
      • Re: Insert policy design questionDrew M.28 Oct
        • Re: Insert policy design questionRick Gutleber28 Oct
        • Re: Insert policy design questionWarren Young28 Oct
  • Re: Insert policy design questionWarren Young28 Oct
    • Re: Insert policy design questionRick Gutleber28 Oct