From c59dfc46864f1fe64e5362f685e770d19754d66d Mon Sep 17 00:00:00 2001 From: randomdan Date: Fri, 11 Feb 2011 14:55:07 +0000 Subject: Support for table patching in different ways according to what the connector says Introduce two proper methods of bulk update Tested against PG 8.4, MySQL 5.1 with single and multiple column keys --- libdbpp/command.h | 3 +-- libdbpp/connection.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libdbpp/command.h b/libdbpp/command.h index 90bd5e4..40b5e2a 100644 --- a/libdbpp/command.h +++ b/libdbpp/command.h @@ -26,8 +26,7 @@ namespace DB { virtual void bindNull(unsigned int i) = 0; - protected: - std::string sql; + const std::string sql; }; } diff --git a/libdbpp/connection.h b/libdbpp/connection.h index 8959840..b350842 100644 --- a/libdbpp/connection.h +++ b/libdbpp/connection.h @@ -6,6 +6,16 @@ namespace DB { class SelectCommand; class ModifyCommand; + enum BulkDeleteStyle { + BulkDeleteUsingSubSelect, + BulkDeleteUsingUsing, + BulkDeleteUsingUsingAlias, + }; + enum BulkUpdateStyle { + BulkUpdateByIteration, + BulkUpdateUsingFromSrc, + BulkUpdateUsingJoin, + }; class Connection { public: virtual ~Connection(); @@ -15,6 +25,8 @@ namespace DB { virtual int rollbackTx() const = 0; virtual bool inTx() const = 0; virtual void ping() const = 0; + virtual BulkDeleteStyle bulkDeleteStyle() const = 0; + virtual BulkUpdateStyle bulkUpdateStyle() const = 0; virtual SelectCommand * newSelectCommand(const std::string & sql) const = 0; virtual ModifyCommand * newModifyCommand(const std::string & sql) const = 0; -- cgit v1.2.3