diff options
Diffstat (limited to 'odb/mysql/traits.hxx')
-rw-r--r-- | odb/mysql/traits.hxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/odb/mysql/traits.hxx b/odb/mysql/traits.hxx index 7f96c0b..b5c9830 100644 --- a/odb/mysql/traits.hxx +++ b/odb/mysql/traits.hxx @@ -9,6 +9,7 @@ #include <odb/pre.hxx> #include <string> +#include <vector> #include <cstddef> // std::size_t #include <odb/traits.hxx> @@ -289,6 +290,35 @@ namespace odb { }; + // std::vector<char> (buffer) specialization. + // + template <> + struct LIBODB_MYSQL_EXPORT default_value_traits<std::vector<char>, id_blob> + { + public: + typedef std::vector<char> value_type; + typedef std::vector<char> query_type; + typedef details::buffer image_type; + + static void + set_value (value_type& v, + const details::buffer& b, + std::size_t n, + bool is_null) + { + if (!is_null) + v.assign (b.data (), b.data () + n); + else + v.clear (); + } + + static void + set_image (details::buffer&, + std::size_t& n, + bool& is_null, + const value_type&); + }; + // // type_traits // |