From 534ad38e3aae8354bd6ede94fe7b1b7259a598ec Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 6 Feb 2021 18:03:49 +0200 Subject: feat: method for listing ids of chunks from file data This will be useful soon, to enable us to check how many chunks from file data there is in the repository, to check that an upcoming chunk size setting works. Also add an API call for returning the ids. Note that all of this is meant for testing only. It may be best to disable it in production builds, eventually. --- src/bin/obnam-server.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/bin/obnam-server.rs') diff --git a/src/bin/obnam-server.rs b/src/bin/obnam-server.rs index 19f2e99..0e9d4e6 100644 --- a/src/bin/obnam-server.rs +++ b/src/bin/obnam-server.rs @@ -188,6 +188,8 @@ pub async fn search_chunks( } if key == "generation" && value == "true" { store.find_generations().expect("SQL lookup failed") + } else if key == "data" && value == "true" { + store.find_file_chunks().expect("SQL lookup failed") } else if key == "sha256" { store.find_by_sha256(value).expect("SQL lookup failed") } else { -- cgit v1.2.1