@@ -218,9 +218,73 @@ bool sql_value_traits<double>::read(double& v, SqlStatement *statement,
218218}
219219
220220 /*
221- * std::vector<unsigned char>
221+ * boost::posix_time::ptime
222222 */
223223
224+ const char * sql_value_traits < boost ::posix_time ::ptime >
225+ ::type (SqlConnection * conn , int size )
226+ {
227+ return conn -> dateTimeType (SqlDateTime );
228+ }
229+
230+ void sql_value_traits < boost ::posix_time ::ptime >
231+ ::bind (const boost ::posix_time ::ptime & v , SqlStatement * statement ,
232+ int column , int size )
233+ {
234+ if (v .is_special ())
235+ statement -> bindNull (column );
236+ else
237+ statement -> bind (column , v , SqlDateTime );
238+ }
239+
240+ bool sql_value_traits < boost ::posix_time ::ptime >
241+ ::read (boost ::posix_time ::ptime & v , SqlStatement * statement , int column ,
242+ int size )
243+ {
244+ if (statement -> getResult (column , & v , SqlDateTime ))
245+ return true;
246+ else {
247+ v = boost ::posix_time ::ptime ();
248+ return false;
249+ }
250+ }
251+
252+ /*
253+ * boost::posix_time::time_duration
254+ */
255+
256+ const char * sql_value_traits < boost ::posix_time ::time_duration >
257+ ::type (SqlConnection * conn , int size )
258+ {
259+ return conn -> dateTimeType (SqlTime );
260+ }
261+
262+ void sql_value_traits < boost ::posix_time ::time_duration >
263+ ::bind (const boost ::posix_time ::time_duration & v , SqlStatement * statement ,
264+ int column , int size )
265+ {
266+ if (v .is_special ())
267+ statement -> bindNull (column );
268+ else
269+ statement -> bind (column , v );
270+ }
271+
272+ bool sql_value_traits < boost ::posix_time ::time_duration >
273+ ::read (boost ::posix_time ::time_duration & v , SqlStatement * statement ,
274+ int column , int size )
275+ {
276+ if (statement -> getResult (column , & v ))
277+ return true;
278+ else {
279+ v = boost ::posix_time ::time_duration (boost ::posix_time ::not_a_date_time );
280+ return false;
281+ }
282+ }
283+
284+ /*
285+ * std::vector<unsigned char>
286+ */
287+
224288const char * sql_value_traits < std ::vector < unsigned char > >
225289::type (SqlConnection * conn , int size )
226290{
0 commit comments