diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2024-01-24 19:01:49 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2024-01-24 19:01:49 +0300 |
commit | ba80b1f8c8354103bb98d31e252c64254f288273 (patch) | |
tree | 6e0fe6e82a58ee0fa4f9817dfc764ac5285a2368 /libodb-sqlite/odb/sqlite/section-statements.txx | |
parent | b650caf5661dec901eae39e374c2c2ebd625d152 (diff) | |
parent | e5d0186db99492a139237067bab841a5b83463af (diff) |
Merge branch 'libodb-sqlite' into multi-package
Diffstat (limited to 'libodb-sqlite/odb/sqlite/section-statements.txx')
-rw-r--r-- | libodb-sqlite/odb/sqlite/section-statements.txx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/libodb-sqlite/odb/sqlite/section-statements.txx b/libodb-sqlite/odb/sqlite/section-statements.txx new file mode 100644 index 0000000..ff588b3 --- /dev/null +++ b/libodb-sqlite/odb/sqlite/section-statements.txx @@ -0,0 +1,40 @@ +// file : odb/sqlite/section-statements.txx +// license : GNU GPL v2; see accompanying LICENSE file + +#include <cstring> // std::memset + +namespace odb +{ + namespace sqlite + { + template <typename T, typename ST> + section_statements<T, ST>:: + section_statements (connection_type& conn, + image_type& im, id_image_type&, + binding& id, binding& idv) + : conn_ (conn), + svm_ (0), + image_ (im), + id_binding_ (id), + idv_binding_ (idv), + select_image_binding_ (select_image_bind_, + select_column_count + + managed_optimistic_load_column_count), + update_image_binding_ (update_image_bind_, + update_column_count + id_column_count + + managed_optimistic_update_column_count) + { + select_image_version_ = 0; + update_image_version_ = 0; + update_id_binding_version_ = 0; + + std::memset (select_image_bind_, 0, sizeof (select_image_bind_)); + std::memset ( + select_image_truncated_, 0, sizeof (select_image_truncated_)); + std::memset (update_image_bind_, 0, sizeof (update_image_bind_)); + + for (std::size_t i (0); i < select_bind_count; ++i) + select_image_bind_[i].truncated = select_image_truncated_ + i; + } + } +} |