diff options
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) |