diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2024-02-02 15:05:07 +0000 |
|---|---|---|
| committer | Ellie Huxtable <ellie@elliehuxtable.com> | 2024-02-02 18:01:09 +0000 |
| commit | c9a453289e2fea97b5ac17e265f99332edcdcd4c (patch) | |
| tree | e51eb1f7d2fd3b44fabf2c1260802232fa0367b2 /atuin-server-postgres/src | |
| parent | feat: failure to decrypt history = failure to sync (diff) | |
| download | atuin-c9a453289e2fea97b5ac17e265f99332edcdcd4c.zip | |
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
```
Diffstat (limited to '')
| -rw-r--r-- | atuin-server-postgres/src/lib.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/atuin-server-postgres/src/lib.rs b/atuin-server-postgres/src/lib.rs index 1f7cf47a..0ad33076 100644 --- a/atuin-server-postgres/src/lib.rs +++ b/atuin-server-postgres/src/lib.rs @@ -133,6 +133,19 @@ impl Database for Postgres { Ok(res.0 as i64) } + async fn delete_store(&self, user: &User) -> DbResult<()> { + sqlx::query( + "delete from store + where user_id = $1", + ) + .bind(user.id) + .execute(&self.pool) + .await + .map_err(fix_error)?; + + Ok(()) + } + async fn delete_history(&self, user: &User, id: String) -> DbResult<()> { sqlx::query( "update history |
