From 5b0430fdf4617b396e462872d438a663b174a3a8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 12 Oct 2012 17:24:44 +0200 Subject: Completion of prepared query support --- odb/connection.txx | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'odb/connection.txx') diff --git a/odb/connection.txx b/odb/connection.txx index c5662d9..7861851 100644 --- a/odb/connection.txx +++ b/odb/connection.txx @@ -4,13 +4,42 @@ namespace odb { - template - prepared_query connection:: - prepare_query (const char* n, const query& q) + template + struct connection::query_ { - //@@ Views. Inline? - // - return prepared_query ( - object_traits_impl::prepare_query (*this, n, q)); + template + static prepared_query + call (connection& c, const char* n, const Q& q) + { + // C++ compiler complaining there is no prepare_query()? Perhaps + // you forgot to specify --generate-prepared when compiling your + // persistent classes. + // + return prepared_query ( + object_traits_impl::prepare_query (c, n, q)); + } + }; + + template + struct connection::query_ + { + template + static prepared_query + call (connection& c, const char* n, const Q& q) + { + // C++ compiler complaining there is no prepare_query()? Perhaps + // you forgot to specify --generate-prepared when compiling your + // views. + // + return prepared_query ( + view_traits_impl::prepare_query (c, n, q)); + } + }; + + template + void connection:: + params_deleter (void* p) + { + delete static_cast (p); } } -- cgit v1.1