diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-10 14:10:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-09-17 12:04:01 +0200 |
commit | 31fd2870497686667f20b2d43467a07482f8ab40 (patch) | |
tree | 9e8fc08cd23b52699c62149f665f32df8892c7c1 /odb/sqlite/container-statements.hxx | |
parent | c3248cd60418cee935508f62a3436970f9d234b2 (diff) |
Schema versioning support
Diffstat (limited to 'odb/sqlite/container-statements.hxx')
-rw-r--r-- | odb/sqlite/container-statements.hxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/odb/sqlite/container-statements.hxx b/odb/sqlite/container-statements.hxx index e9c2d3b..058a255 100644 --- a/odb/sqlite/container-statements.hxx +++ b/odb/sqlite/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/sqlite/version.hxx> @@ -57,6 +58,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& @@ -114,7 +123,10 @@ namespace odb if (insert_ == 0) insert_.reset ( new (details::shared) insert_statement_type ( - conn_, insert_text_, insert_image_binding_)); + conn_, + insert_text_, + versioned_, // Process if versioned. + insert_image_binding_)); return *insert_; } @@ -127,6 +139,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_)); @@ -167,6 +181,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_; @@ -270,6 +287,7 @@ namespace odb new (details::shared) update_statement_type ( this->conn_, update_text_, + this->versioned_, // Process if versioned. update_image_binding_)); return *update_; |