aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/container-statements.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/sqlite/container-statements.hxx')
-rw-r--r--odb/sqlite/container-statements.hxx20
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_;