aboutsummaryrefslogtreecommitdiff
path: root/libbrep
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-08-06 22:03:31 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-08-07 19:19:22 +0300
commit443088f6093d3420212be0e1af3b9e802dca9362 (patch)
treeb1ec3b0c62ee0b8d66b0cbf21e21d68ae0d4f806 /libbrep
parent7db53790ca2d2c004bfd00b503eca59a8d084870 (diff)
Add support for advanced package search
Diffstat (limited to 'libbrep')
-rw-r--r--libbrep/package.hxx16
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;