aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-06-02 16:32:30 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-06-02 16:32:30 +0200
commit6b00d1a2e4c7675eca17e96bcbfcbf1c259bd850 (patch)
tree9c80a2c33687c32bb0a164ea5bc106c52039da05
parent4fc5f1933af8a2d709a4ad7fa674f763725010a6 (diff)
Add date/time type image_traits
-rw-r--r--odb/pgsql/traits.hxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/odb/pgsql/traits.hxx b/odb/pgsql/traits.hxx
index 847f13e..45c92e3 100644
--- a/odb/pgsql/traits.hxx
+++ b/odb/pgsql/traits.hxx
@@ -97,6 +97,19 @@ namespace odb
template <>
struct image_traits<id_uuid> {typedef unsigned char* image_type;};
+ // @@ Date/time binary support in PostgreSQL is sketchy and in some
+ // cases depends on server compile time constants. Using strings
+ // to avoid this.
+ //
+ template <>
+ struct image_traits<id_date> {typedef details::buffer image_type;};
+
+ template <>
+ struct image_traits<id_time> {typedef details::buffer image_type;};
+
+ template <>
+ struct image_traits<id_timestamp> {typedef details::buffer image_type;};
+
//
// value_traits
//
@@ -225,7 +238,7 @@ namespace odb
struct default_type_traits;
template <typename T>
- class type_traits: public default_type_traits<T>
+ class type_traits: public default_type_traits<T>
{
};