aboutsummaryrefslogtreecommitdiff
path: root/odb/oracle/query.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-07-10 15:17:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-07-10 15:17:15 +0200
commit304dbce8fa2a5d033870988d17709e3eae050258 (patch)
tree7ce174a99a26025480cea4bc6ee215ab1fe6c27e /odb/oracle/query.cxx
parentc10f6d2d60d1333df2d0907b2957ff52deb203ac (diff)
Add support for custom database type mapping
New pragma qualifier, map, and specifiers: as, to, from. New tests: <database>/custom.
Diffstat (limited to 'odb/oracle/query.cxx')
-rw-r--r--odb/oracle/query.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/odb/oracle/query.cxx b/odb/oracle/query.cxx
index 53a7991..f2cdac1 100644
--- a/odb/oracle/query.cxx
+++ b/odb/oracle/query.cxx
@@ -119,10 +119,13 @@ namespace odb
}
void query::
- add (details::shared_ptr<query_param> p)
+ add (details::shared_ptr<query_param> p, const char* conv)
{
clause_.push_back (clause_part (clause_part::param));
+ if (conv != 0)
+ clause_.back ().part = conv;
+
parameters_.push_back (p);
bind_.push_back (bind ());
binding_.bind = &bind_[0];
@@ -262,8 +265,22 @@ namespace odb
ostringstream os;
os << param++;
+
+ // Add the conversion expression, if any.
+ //
+ string::size_type p;
+ if (!i->part.empty ())
+ {
+ p = i->part.find ("(?)");
+ r.append (i->part, 0, p);
+ }
+
r += ':';
r += os.str ();
+
+ if (!i->part.empty ())
+ r.append (i->part, p + 3, string::npos);
+
break;
}
case clause_part::native: