aboutsummaryrefslogtreecommitdiff
path: root/libbrep
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-07-07 14:08:34 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-07-07 15:19:59 +0300
commit37af85f5b084c234a350235690eb944984567e78 (patch)
tree8a63a39711e9831e456ebdc1f783c10053805865 /libbrep
parentb125c5f1ca398d4c912ecfba3bf451bfa63b6293 (diff)
Add odb sections to build_package class
Diffstat (limited to 'libbrep')
-rw-r--r--libbrep/build-package.hxx47
1 files changed, 38 insertions, 9 deletions
diff --git a/libbrep/build-package.hxx b/libbrep/build-package.hxx
index e9104e0..2e3afe0 100644
--- a/libbrep/build-package.hxx
+++ b/libbrep/build-package.hxx
@@ -5,6 +5,7 @@
#define LIBBREP_BUILD_PACKAGE_HXX
#include <odb/core.hxx>
+#include <odb/section.hxx>
#include <odb/nested-container.hxx>
#include <libbrep/types.hxx>
@@ -119,6 +120,8 @@ namespace brep
requirements_type requirements;
small_vector<build_test_dependency, 1> tests;
+ odb::section requirements_tests_section;
+
lazy_shared_ptr<build_repository> internal_repository;
bool buildable;
@@ -129,6 +132,12 @@ namespace brep
build_constraints constraints;
build_package_configs configs;
+ // Group the builds and constraints members of this object as well as of
+ // the nested configs entries for an explicit load. Note that the configs
+ // top-level members are loaded implicitly.
+ //
+ odb::section constraints_section;
+
bool
internal () const noexcept {return internal_repository != nullptr;}
@@ -145,7 +154,8 @@ namespace brep
// Container of the requirement_alternatives values.
//
- #pragma db member(requirements) id_column("") value_column("")
+ #pragma db member(requirements) id_column("") value_column("") \
+ section(requirements_tests_section)
// Container of the requirement_alternative values.
//
@@ -154,7 +164,8 @@ namespace brep
after(requirements) \
get(odb::nested_get (this.requirements)) \
set(odb::nested_set (this.requirements, std::move (?))) \
- id_column("") key_column("") value_column("")
+ id_column("") key_column("") value_column("") \
+ section(requirements_tests_section)
// Container of the requirement (string) values.
//
@@ -163,13 +174,23 @@ namespace brep
after(requirement_alternatives) \
get(odb::nested2_get (this.requirements)) \
set(odb::nested2_set (this.requirements, std::move (?))) \
- id_column("") key_column("") value_column("id")
+ id_column("") key_column("") value_column("id") \
+ section(requirements_tests_section)
+
+ // tests
+ //
+ #pragma db member(tests) id_column("") value_column("test_") \
+ section(requirements_tests_section)
+
+ #pragma db member(requirements_tests_section) load(lazy) update(always)
- // tests, builds, and constraints
+ // builds and constraints
//
- #pragma db member(tests) id_column("") value_column("test_")
- #pragma db member(builds) id_column("") value_column("")
- #pragma db member(constraints) id_column("") value_column("")
+ #pragma db member(builds) id_column("") value_column("") \
+ section(constraints_section)
+
+ #pragma db member(constraints) id_column("") value_column("") \
+ section(constraints_section)
// configs
//
@@ -187,7 +208,8 @@ namespace brep
set(brep::build_package_config_builds bs; \
odb::nested_set (bs, std::move (?)); \
move (bs).to_configs (this.configs)) \
- id_column("") key_column("") value_column("")
+ id_column("") key_column("") value_column("") \
+ section(constraints_section)
#pragma db member(config_constraints) \
virtual(build_constraints_map) \
@@ -197,7 +219,10 @@ namespace brep
set(brep::build_package_config_constraints cs; \
odb::nested_set (cs, std::move (?)); \
move (cs).to_configs (this.configs)) \
- id_column("") key_column("") value_column("")
+ id_column("") key_column("") value_column("") \
+ section(constraints_section)
+
+ #pragma db member(constraints_section) load(lazy) update(always)
private:
friend class odb::access;
@@ -223,6 +248,10 @@ namespace brep
bool archived; // True if the tenant the package belongs to is archived.
+ // Present if the tenant the package belongs to is interactive.
+ //
+ optional<string> interactive;
+
// Database mapping.
//
#pragma db member(version) set(this.version.init (this.id.version, (?)))