diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2023-07-08 12:05:09 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2023-07-13 16:43:12 +0300 |
commit | 5af5a6c6aa4c2b31e63d64a43ab647bd6def3808 (patch) | |
tree | f0c04dad8662dadd1fd2120d475fbbb8e88aedb9 /libbrep | |
parent | 0a8932b1eda3b4152a542dec94b4338a2f5f9691 (diff) |
Optimize build-task handler by using object loading view
Diffstat (limited to 'libbrep')
-rw-r--r-- | libbrep/build-package.hxx | 18 |
1 files changed, 12 insertions, 6 deletions
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<build_package> package; bool archived; // True if the tenant the package belongs to is archived. // Present if the tenant the package belongs to is interactive. // optional<string> interactive; - - // Database mapping. - // - #pragma db member(version) set(this.version.init (this.id.version, (?))) }; #pragma db view \ |