summaryrefslogtreecommitdiff
path: root/src/bin/obnam-server.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-02-06 18:03:49 +0200
committerLars Wirzenius <liw@liw.fi>2021-02-06 18:10:47 +0200
commit534ad38e3aae8354bd6ede94fe7b1b7259a598ec (patch)
tree5c2ebcb90c80dcb118d7c15ec7fe9aae17cff7f2 /src/bin/obnam-server.rs
parent375d05a8492c391b229b65a8752c4151ffd5bb20 (diff)
downloadobnam2-534ad38e3aae8354bd6ede94fe7b1b7259a598ec.tar.gz
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.
Diffstat (limited to 'src/bin/obnam-server.rs')
-rw-r--r--src/bin/obnam-server.rs2
1 files changed, 2 insertions, 0 deletions
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 {