From 5af5a6c6aa4c2b31e63d64a43ab647bd6def3808 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sat, 8 Jul 2023 12:05:09 +0300 Subject: Optimize build-task handler by using object loading view --- libbrep/build-package.hxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'libbrep') diff --git a/libbrep/build-package.hxx b/libbrep/build-package.hxx index 2e3afe0..50294a3 100644 --- a/libbrep/build-package.hxx +++ b/libbrep/build-package.hxx @@ -229,6 +229,17 @@ namespace brep build_package () = default; }; + #pragma db view object(build_package) + struct build_package_version + { + package_id id; + upstream_version version; + + // Database mapping. + // + #pragma db member(version) set(this.version.init (this.id.version, (?))) + }; + // Packages that can potentially be built. // // Note that ADL can't find the equal operator, so we use the function call @@ -243,18 +254,13 @@ namespace brep object(build_tenant: build_package::id.tenant == build_tenant::id) struct buildable_package { - package_id id; - upstream_version version; + shared_ptr package; bool archived; // True if the tenant the package belongs to is archived. // Present if the tenant the package belongs to is interactive. // optional interactive; - - // Database mapping. - // - #pragma db member(version) set(this.version.init (this.id.version, (?))) }; #pragma db view \ -- cgit v1.1