From c9a453289e2fea97b5ac17e265f99332edcdcd4c Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Fri, 2 Feb 2024 15:05:07 +0000 Subject: feat: add `store push --force` This will 1. Wipe the remote store 2. Upload all of the local store to remote Imagine the scenario where you end up with some mixed keys locally :( You confirm this with ``` atuin store verify ``` You then fix it locally with ``` atuin store purge ``` Ensure that your local changes are reflected remotely with ``` atuin store push --force ``` and then (another PR, coming soon), update all other hosts with ``` atuin store pull --force ``` --- atuin-client/src/api_client.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'atuin-client/src/api_client.rs') diff --git a/atuin-client/src/api_client.rs b/atuin-client/src/api_client.rs index d53c9a36..709627b6 100644 --- a/atuin-client/src/api_client.rs +++ b/atuin-client/src/api_client.rs @@ -287,6 +287,17 @@ impl<'a> Client<'a> { Ok(()) } + pub async fn delete_store(&self) -> Result<()> { + let url = format!("{}/api/v0/store", self.sync_addr); + let url = Url::parse(url.as_str())?; + + let resp = self.client.delete(url).send().await?; + + handle_resp_error(resp).await?; + + Ok(()) + } + pub async fn post_records(&self, records: &[Record]) -> Result<()> { let url = format!("{}/api/v0/record", self.sync_addr); let url = Url::parse(url.as_str())?; -- cgit v1.3.1