From 0a71eaad620be004e7e28e7d3265a373dcd92395 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/sqlite/statement.hxx | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'odb/sqlite/statement.hxx') diff --git a/odb/sqlite/statement.hxx b/odb/sqlite/statement.hxx index 4fad1a3..4f1e3fd 100644 --- a/odb/sqlite/statement.hxx +++ b/odb/sqlite/statement.hxx @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include @@ -30,18 +30,21 @@ namespace odb { class connection; - class LIBODB_SQLITE_EXPORT statement: public details::shared_base + class LIBODB_SQLITE_EXPORT statement: public odb::statement { public: virtual ~statement () = 0; sqlite3_stmt* - handle () + handle () const { return stmt_; } + virtual const char* + text () const; + // Cached state (public part). // public: @@ -130,11 +133,7 @@ namespace odb // protected: void - finilize () - { - list_remove (); - stmt_.reset (); - } + finilize (); protected: friend class connection; @@ -191,18 +190,18 @@ namespace odb statement* next_; }; - class LIBODB_SQLITE_EXPORT simple_statement: public statement + class LIBODB_SQLITE_EXPORT generic_statement: public statement { public: - simple_statement (connection&, const std::string& statement); - simple_statement (connection&, const char* statement, std::size_t n); + generic_statement (connection&, const std::string& statement); + generic_statement (connection&, const char* statement, std::size_t n); unsigned long long execute (); private: - simple_statement (const simple_statement&); - simple_statement& operator= (const simple_statement&); + generic_statement (const generic_statement&); + generic_statement& operator= (const generic_statement&); private: bool result_set_; -- cgit v1.1