diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-04-01 23:01:02 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-04-06 15:09:41 +0300 |
commit | 65ba2b47c8d6c83e37fe772a7b54fd6b7480ce17 (patch) | |
tree | f24967df1c447e10c43206cf599007e98c24afb7 /libbrep/build-package.hxx | |
parent | d1662abccb91be4844efc1508ff8b0427019a27c (diff) |
Add support for test-exclude task manifest valuemigration-example
Note that the last two commits demonstrate an approach to use for migrating
data on the ODB object member type change.
Diffstat (limited to 'libbrep/build-package.hxx')
-rw-r--r-- | libbrep/build-package.hxx | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/libbrep/build-package.hxx b/libbrep/build-package.hxx index ffa9d0b..85d94e6 100644 --- a/libbrep/build-package.hxx +++ b/libbrep/build-package.hxx @@ -68,6 +68,19 @@ namespace brep build_repository (): canonical_name (id.canonical_name) {} }; + // Forward declarations. + // + class build_package; + + // Build package test dependency. + // + #pragma db value + struct build_dependency + { + package_name name; + lazy_shared_ptr<build_package> package; + }; + // Foreign object that is mapped to a subset of the package object. // #pragma db object table("build_package") pointer(shared_ptr) readonly session @@ -76,8 +89,16 @@ namespace brep public: package_id id; upstream_version version; + + // Mapped to the package object tests, examples, and benchmarks members + // using the PostgreSQL foreign table mechanism. + // + small_vector<build_dependency, 1> tests; + small_vector<build_dependency, 1> examples; + small_vector<build_dependency, 1> benchmarks; + lazy_shared_ptr<build_repository> internal_repository; - bool buildable; + buildable_status buildable; // Mapped to the package object builds member using the PostgreSQL foreign // table mechanism. @@ -89,15 +110,19 @@ namespace brep // build_constraints constraints; + bool + internal () const noexcept {return internal_repository != nullptr;} + // Database mapping. // #pragma db member(id) id column("") #pragma db member(version) set(this.version.init (this.id.version, (?))) + #pragma db member(tests) id_column("") value_column("dep_") + #pragma db member(examples) id_column("") value_column("dep_") + #pragma db member(benchmarks) id_column("") value_column("dep_") #pragma db member(builds) id_column("") value_column("") #pragma db member(constraints) id_column("") value_column("") - #pragma db member(buildable) column("buildable_") - private: friend class odb::access; build_package () = default; @@ -111,7 +136,7 @@ namespace brep #pragma db view \ object(build_package) \ object(build_repository inner: \ - build_package::buildable && \ + build_package::buildable == "buildable" && \ brep::operator== (build_package::internal_repository, \ build_repository::id)) \ object(build_tenant: build_package::id.tenant == build_tenant::id) @@ -130,7 +155,7 @@ namespace brep #pragma db view \ object(build_package) \ object(build_repository inner: \ - build_package::buildable && \ + build_package::buildable == "buildable" && \ brep::operator== (build_package::internal_repository, \ build_repository::id)) \ object(build_tenant: build_package::id.tenant == build_tenant::id) |