aboutsummaryrefslogtreecommitdiff
path: root/odb/oracle/traits.hxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-11-07 15:02:14 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-11-08 14:46:33 +0200
commit655fc5c0827d56b6eaa86f80c904d9a607530fcb (patch)
treecf4679282bb15dd15c73ff429e0b20428eb58650 /odb/oracle/traits.hxx
parent60d4d13a85130ccdc3b232e420bc3c18683846b9 (diff)
Implement support for Oracle temporal types
Diffstat (limited to 'odb/oracle/traits.hxx')
-rw-r--r--odb/oracle/traits.hxx28
1 files changed, 19 insertions, 9 deletions
diff --git a/odb/oracle/traits.hxx b/odb/oracle/traits.hxx
index e8c3ec2..2ad3054 100644
--- a/odb/oracle/traits.hxx
+++ b/odb/oracle/traits.hxx
@@ -47,6 +47,8 @@ namespace odb
id_date,
id_timestamp,
+ id_interval_ym,
+ id_interval_ds,
id_string,
id_nstring,
@@ -181,11 +183,19 @@ namespace odb
template <typename T>
struct image_traits<T, id_timestamp>
{
- // Image is a buffer containing the native OCI TIMESTAMP representation.
- // This buffer has varying length, depending on the microsecond
- // precision of the TIMESTAMP value.
- //
- typedef char* image_type;
+ typedef datetime image_type;
+ };
+
+ template <typename T>
+ struct image_traits<T, id_interval_ym>
+ {
+ typedef interval_ym image_type;
+ };
+
+ template <typename T>
+ struct image_traits<T, id_interval_ds>
+ {
+ typedef interval_ds image_type;
};
template <typename T>
@@ -266,7 +276,7 @@ namespace odb
vtraits::set_image (i, is_null, wtraits::get_ref (v));
}
- // big_int, big_float, timestamp, string, nstring, raw.
+ // big_int, big_float, string, nstring, raw.
//
static void
set_value (W& v, const char* i, std::size_t n, bool is_null)
@@ -274,7 +284,7 @@ namespace odb
vtraits::set_value (wtraits::set_ref (v), i, n, is_null);
}
- // timestamp, string, nstring, raw.
+ // string, nstring, raw.
//
static void
set_image (char* i,
@@ -342,7 +352,7 @@ namespace odb
vtraits::set_image (i, is_null, wtraits::get_ref (v));
}
- // big_int, big_float, timestamp, string, nstring, raw.
+ // big_int, big_float, string, nstring, raw.
//
static void
set_value (W& v, const char* i, std::size_t n, bool is_null)
@@ -353,7 +363,7 @@ namespace odb
vtraits::set_value (wtraits::set_ref (v), i, n, is_null);
}
- // timestamp, string, nstring, raw.
+ // string, nstring, raw.
//
static void
set_image (char* i,