diff options
Diffstat (limited to 'odb/mysql/statement.hxx')
-rw-r--r-- | odb/mysql/statement.hxx | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/odb/mysql/statement.hxx b/odb/mysql/statement.hxx index b635975..ec79b67 100644 --- a/odb/mysql/statement.hxx +++ b/odb/mysql/statement.hxx @@ -48,6 +48,12 @@ namespace odb virtual ~statement () = 0; + // Cancel the statement execution (e.g., result fetching) so + // that another statement can be executed on the connection. + // + virtual void + cancel (); + protected: statement (connection&); @@ -56,6 +62,49 @@ namespace odb MYSQL_STMT* stmt_; }; + class query_statement: public statement + { + public: + virtual + ~query_statement (); + + query_statement (connection& conn, + const std::string& query, + binding& image, + MYSQL_BIND* parameters); + enum result + { + success, + no_data, + truncated + }; + + void + execute (); + + result + fetch (); + + void + refetch (); + + void + free_result (); + + virtual void + cancel (); + + private: + query_statement (const query_statement&); + query_statement& operator= (const query_statement&); + + private: + binding& image_; + std::size_t image_version_; + + MYSQL_BIND* parameters_; + }; + class insert_statement: public statement { public: @@ -107,6 +156,8 @@ namespace odb void free_result (); + void + cancel (); private: select_statement (const select_statement&); @@ -279,6 +330,10 @@ namespace odb } private: + object_statements (const object_statements&); + object_statements& operator= (const object_statements&); + + private: // The last element is the id parameter. The update statement // depends on this being one contiguous arrays. // |