diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-10-12 17:24:44 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-10-12 17:24:44 +0200 |
commit | fef380f6c9a5fb9904d551478fe180a9c5d24b37 (patch) | |
tree | 06cd811ee093e0e52cb5e029f0705b8e6323a334 /odb/pgsql/query.cxx | |
parent | 9f994010f871ce0ea1aea58482ddef503cfc81c3 (diff) |
Completion of prepared query support
Diffstat (limited to 'odb/pgsql/query.cxx')
-rw-r--r-- | odb/pgsql/query.cxx | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/odb/pgsql/query.cxx b/odb/pgsql/query.cxx index 2233110..966df92 100644 --- a/odb/pgsql/query.cxx +++ b/odb/pgsql/query.cxx @@ -222,19 +222,12 @@ namespace odb statement::bind_param (native_binding_, binding_); } - native_binding& query_base:: - parameters_binding () const + void query_base:: + init_parameters () const { - size_t n (parameters_.size ()); - - if (n == 0) - return native_binding_; - bool ref (false), inc_ver (false); - binding& r (binding_); - bind* b (&bind_[0]); - for (size_t i (0); i < n; ++i) + for (size_t i (0); i < parameters_.size (); ++i) { query_param& p (*parameters_[i]); @@ -244,7 +237,7 @@ namespace odb if (p.init ()) { - p.bind (b + i); + p.bind (&bind_[i]); inc_ver = true; } } @@ -255,10 +248,8 @@ namespace odb statement::bind_param (native_binding_, binding_); if (inc_ver) - r.version++; + binding_.version++; } - - return native_binding_; } static bool |