aboutsummaryrefslogtreecommitdiff
path: root/odb/pgsql/traits.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/pgsql/traits.cxx')
-rw-r--r--odb/pgsql/traits.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/odb/pgsql/traits.cxx b/odb/pgsql/traits.cxx
index bdffa45..1c167b8 100644
--- a/odb/pgsql/traits.cxx
+++ b/odb/pgsql/traits.cxx
@@ -54,5 +54,27 @@ namespace odb
if (n != 0)
memcpy (b.data (), v, n);
}
+
+ //
+ // default_value_traits<vector<char>, id_bytea>
+ //
+
+ void default_value_traits<vector<char>, id_bytea>::
+ set_image (details::buffer& b,
+ size_t& n,
+ bool& is_null,
+ const value_type& v)
+ {
+ is_null = false;
+ n = v.size ();
+
+ if (n > b.capacity ())
+ b.capacity (n);
+
+ // std::vector::data() may not be available in older compilers.
+ //
+ if (n != 0)
+ memcpy (b.data (), &v[0], n);
+ }
}
}