diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-07-13 10:03:09 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-07-13 10:03:09 +0200 |
commit | e607b4dfb03f17e073725013df12a11547fc6a54 (patch) | |
tree | 2b74ffb991b763a87fc9a26b6cca7b5f3d64db8d /odb/pgsql/traits.hxx | |
parent | beb52e1cbd129549a4c70c44d567c891f656359f (diff) |
Add support for DATE, TIME and TIMESTAMP SQL types
Diffstat (limited to 'odb/pgsql/traits.hxx')
-rw-r--r-- | odb/pgsql/traits.hxx | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/odb/pgsql/traits.hxx b/odb/pgsql/traits.hxx index 1fbcc26..8308688 100644 --- a/odb/pgsql/traits.hxx +++ b/odb/pgsql/traits.hxx @@ -78,6 +78,15 @@ namespace odb struct image_traits<id_double> {typedef double image_type;}; template <> + struct image_traits<id_date> {typedef int image_type;}; + + template <> + struct image_traits<id_time> {typedef long long image_type;}; + + template <> + struct image_traits<id_timestamp> {typedef long long image_type;}; + + template <> struct image_traits<id_string> {typedef details::buffer image_type;}; template <> @@ -94,19 +103,6 @@ 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 // |