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/simple-object-result.txx | |
parent | c3248cd60418cee935508f62a3436970f9d234b2 (diff) |
Schema versioning support
Diffstat (limited to 'odb/sqlite/simple-object-result.txx')
-rw-r--r-- | odb/sqlite/simple-object-result.txx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/odb/sqlite/simple-object-result.txx b/odb/sqlite/simple-object-result.txx index fe31300..2c4340d 100644 --- a/odb/sqlite/simple-object-result.txx +++ b/odb/sqlite/simple-object-result.txx @@ -39,11 +39,13 @@ namespace odb object_result_impl<T>:: object_result_impl (const query_base& q, const details::shared_ptr<select_statement>& s, - statements_type& sts) + statements_type& sts, + const schema_version_migration* svm) : base_type (sts.connection ()), params_ (q.parameters ()), statement_ (s), - statements_ (sts) + statements_ (sts), + tc_ (svm) { } @@ -62,7 +64,7 @@ namespace odb object_traits::callback (this->db_, obj, callback_event::pre_load); typename object_traits::image_type& i (statements_.image ()); - object_traits::init (obj, i, &this->db_); + tc_.init (obj, i, &this->db_); // Initialize the id image and binding and load the rest of the object // (containers, etc). @@ -78,8 +80,8 @@ namespace odb idb.version++; } - object_traits::load_ (statements_, obj); - statements_.load_delayed (); + tc_.load_ (statements_, obj, false); + statements_.load_delayed (tc_.version ()); l.unlock (); object_traits::callback (this->db_, obj, callback_event::post_load); } @@ -118,7 +120,7 @@ namespace odb if (im.version != statements_.select_image_version ()) { binding& b (statements_.select_image_binding ()); - object_traits::bind (b.bind, im, statement_select); + tc_.bind (b.bind, im, statement_select); statements_.select_image_version (im.version); b.version++; } @@ -127,13 +129,13 @@ namespace odb if (r == select_statement::truncated) { - if (object_traits::grow (im, statements_.select_image_truncated ())) + if (tc_.grow (im, statements_.select_image_truncated ())) im.version++; if (im.version != statements_.select_image_version ()) { binding& b (statements_.select_image_binding ()); - object_traits::bind (b.bind, im, statement_select); + tc_.bind (b.bind, im, statement_select); statements_.select_image_version (im.version); b.version++; statement_->reload (); |