diff options
Diffstat (limited to 'libbrep/package.hxx')
-rw-r--r-- | libbrep/package.hxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libbrep/package.hxx b/libbrep/package.hxx index 668dc5c..e2d2da5 100644 --- a/libbrep/package.hxx +++ b/libbrep/package.hxx @@ -983,6 +983,20 @@ namespace brep search_text (const weighted_text&) {} }; + // Packages count. + // + #pragma db view object(package) + struct package_count + { + size_t result; + + operator size_t () const {return result;} + + // Database mapping. + // + #pragma db member(result) column("count(" + package::id.tenant + ")") + }; + // Package search query matching rank. // #pragma db view query("/*CALL*/ SELECT * FROM search_latest_packages(?)") @@ -1009,7 +1023,7 @@ namespace brep }; #pragma db view query("/*CALL*/ SELECT count(*) FROM search_packages(?)") - struct package_count + struct package_search_count { size_t result; |