diff options
author | randomdan <randomdan@localhost> | 2011-02-11 14:55:07 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2011-02-11 14:55:07 +0000 |
commit | c59dfc46864f1fe64e5362f685e770d19754d66d (patch) | |
tree | 9878d614b90576884bc77fdc4c3d519f5a854e52 | |
parent | Fix the build system to do dependencies properly (diff) | |
download | libdbpp-c59dfc46864f1fe64e5362f685e770d19754d66d.tar.bz2 libdbpp-c59dfc46864f1fe64e5362f685e770d19754d66d.tar.xz libdbpp-c59dfc46864f1fe64e5362f685e770d19754d66d.zip |
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
-rw-r--r-- | libdbpp/command.h | 3 | ||||
-rw-r--r-- | 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; |