diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-10 14:10:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-10 14:10:45 +0200 |
commit | 0ed9ceef3abbd9f4ff786f6a02fe8767780e8c2c (patch) | |
tree | 0bca6f9e302dd92eb4dc9136ab0b826f8fa61aff /odb/mysql/container-statements.hxx | |
parent | 075f64ca84e4e1be22bad30e4974e9b675d12ec8 (diff) |
Schema versioning support
Diffstat (limited to 'odb/mysql/container-statements.hxx')
-rw-r--r-- | odb/mysql/container-statements.hxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/odb/mysql/container-statements.hxx b/odb/mysql/container-statements.hxx index 5d089d7..be86cda 100644 --- a/odb/mysql/container-statements.hxx +++ b/odb/mysql/container-statements.hxx @@ -10,6 +10,7 @@ #include <cstddef> // std::size_t #include <odb/forward.hxx> +#include <odb/schema-version.hxx> #include <odb/traits.hxx> #include <odb/mysql/mysql.hxx> @@ -58,6 +59,14 @@ namespace odb return functions_; } + // Schema version. + // + const schema_version_migration& + version_migration () const {return *svm_;} + + void + version_migration (const schema_version_migration& svm) {svm_ = &svm;} + // Id image binding (external). // const binding& @@ -115,7 +124,11 @@ namespace odb if (insert_ == 0) insert_.reset ( new (details::shared) insert_statement_type ( - conn_, insert_text_, insert_image_binding_, false)); + conn_, + insert_text_, + versioned_, // Process if versioned. + insert_image_binding_, + false)); return *insert_; } @@ -128,6 +141,8 @@ namespace odb new (details::shared) select_statement_type ( conn_, select_text_, + versioned_, // Process if versioned. + false, // Don't optimize. id_binding_, select_image_binding_, false)); @@ -169,6 +184,9 @@ namespace odb const char* select_text_; const char* delete_text_; + bool versioned_; + const schema_version_migration* svm_; + details::shared_ptr<insert_statement_type> insert_; details::shared_ptr<select_statement_type> select_; details::shared_ptr<delete_statement_type> delete_; @@ -273,6 +291,7 @@ namespace odb new (details::shared) update_statement_type ( this->conn_, update_text_, + this->versioned_, // Process if versioned. update_image_binding_, false)); |