From 0e37272b9ab8f37ad2f3d37bf6a09c68e5117d02 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 7 Nov 2011 15:00:06 +0200 Subject: Add support for SQL statement tracing --- odb/pgsql/connection.hxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'odb/pgsql/connection.hxx') diff --git a/odb/pgsql/connection.hxx b/odb/pgsql/connection.hxx index e8a1f17..737551d 100644 --- a/odb/pgsql/connection.hxx +++ b/odb/pgsql/connection.hxx @@ -18,6 +18,7 @@ #include #include +#include #include #include #include // PGconn @@ -62,6 +63,25 @@ namespace odb virtual unsigned long long execute (const char* statement, std::size_t length); + // SQL statement tracing. + // + public: + typedef pgsql::tracer tracer_type; + + void + tracer (tracer_type& t) + { + odb::connection::tracer (t); + } + + void + tracer (tracer_type* t) + { + odb::connection::tracer (t); + } + + using odb::connection::tracer; + public: PGconn* handle () -- cgit v1.1