From: Date: August 15 2007 12:02pm Subject: RE: SSQLSv2 design discussion List-Archive: http://lists.mysql.com/plusplus/6937 Message-Id: <091a01c7df23$614a09c0$0400a8c0@joel> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Warren Young wrote: > A side benefit of the new accessor feature is a solution to the auto increment problem brought up recently by Graham Reitz. Because data members are > hidden behind public member functions, we will know when a field has been explicitly set ("id_is_set_ == true"), and when it retains its default. > If it still retains its default and it is also marked as auto_increment, we will know to leave it out when building an INSERT or UPDATE query. Continuing with the Boost theme as in the "Eyeball" thread, this is boost::optional again. Also, the ability to apply some transform as the result set goes into the SSQLS, e.g. localising a date. Specifically, I wouldn't want to have to reimplement the same transform in more than one SSQLS constructor so it would need to be templatised so that I could pass a LocaliseDate transformer when running the select query, with the transformer having SQLStock operator()(mysqlpp::Row& row) function. You can achieve a similar thing with make_transform_iterator, but the benefit would be that the transform happens once on write rather than on each read from the container, plus of course each set of client code wouldn't need to do the same transform in multiple places. You can currently also use for_each to do it, but maybe there's a place for transform_each? Joel