aboutsummaryrefslogtreecommitdiff
path: root/libbrep/build.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbrep/build.hxx')
-rw-r--r--libbrep/build.hxx39
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