diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-07 15:00:06 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-07 15:00:06 +0200 |
commit | 57d5d8fe9dc4c0d6b4ef21754c5a3539e4c01cf9 (patch) | |
tree | 4daef878ce8276b663a2bc5470e3d9dc37ee2086 /odb/mysql/statement.hxx | |
parent | 2077828442e58677a2af1d15c6d5266455e50cad (diff) |
Add support for SQL statement tracing
Diffstat (limited to 'odb/mysql/statement.hxx')
-rw-r--r-- | odb/mysql/statement.hxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/odb/mysql/statement.hxx b/odb/mysql/statement.hxx index 93adea4..ee1284b 100644 --- a/odb/mysql/statement.hxx +++ b/odb/mysql/statement.hxx @@ -12,7 +12,7 @@ #include <cstddef> // std::size_t #include <odb/forward.hxx> -#include <odb/details/shared-ptr.hxx> +#include <odb/statement.hxx> #include <odb/mysql/mysql.hxx> #include <odb/mysql/version.hxx> @@ -27,12 +27,21 @@ namespace odb { class connection; - class LIBODB_MYSQL_EXPORT statement: public details::shared_base + class LIBODB_MYSQL_EXPORT statement: public odb::statement { public: virtual ~statement () = 0; + MYSQL_STMT* + handle () const + { + return stmt_; + } + + virtual const char* + text () const; + // Cancel the statement execution (e.g., result fetching) so // that another statement can be executed on the connection. // @@ -40,10 +49,11 @@ namespace odb cancel (); protected: - statement (connection&); + statement (connection&, const std::string& text); protected: connection& conn_; + const std::string text_; auto_handle<MYSQL_STMT> stmt_; }; |