diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-06-30 02:53:57 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-07-03 23:56:29 +0300 |
commit | 17d44ec2c41a5b485cecae51a07396f85a601248 (patch) | |
tree | 5b8f74f8176059c9ab8cbbc770e4b9ee75872f41 /libbrep/build.hxx | |
parent | c2a0ae3e226d1cedceb2a7814c8adfbbfbd7afe1 (diff) |
Fix builds page to correctly display unbuilt package count
Diffstat (limited to 'libbrep/build.hxx')
-rw-r--r-- | libbrep/build.hxx | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/libbrep/build.hxx b/libbrep/build.hxx index dd6f10d..7a231bd 100644 --- a/libbrep/build.hxx +++ b/libbrep/build.hxx @@ -17,7 +17,10 @@ #include <libbrep/types.hxx> #include <libbrep/utility.hxx> -#include <libbrep/common.hxx> // Must be included last (see assert). +// Must be included last (see assert in libbrep/common.hxx). +// +#include <libbrep/common.hxx> +#include <libbrep/build-package.hxx> // Used by the data migration entries. // @@ -261,6 +264,40 @@ namespace brep #pragma db transient canonical_version version_; }; + + // Build of an existing internal package. + // + #pragma db view \ + object(build) \ + object(build_package inner: \ + build::id.package.name == build_package::id.name && \ + brep::compare_version_eq (build::id.package.version, \ + build_package::id.version, \ + true) && \ + build_package::internal_repository.is_not_null ()) + struct package_build + { + shared_ptr<brep::build> build; + }; + + #pragma db view \ + object(build) \ + object(build_package inner: \ + build::id.package.name == build_package::id.name && \ + brep::compare_version_eq (build::id.package.version, \ + build_package::id.version, \ + true) && \ + build_package::internal_repository.is_not_null ()) + struct package_build_count + { + size_t result; + + operator size_t () const {return result;} + + // Database mapping. + // + #pragma db member(result) column("count(" + build::id.package.name + ")") + }; } #endif // LIBBREP_BUILD_HXX |