diff options
Diffstat (limited to 'atuin-client/src')
| -rw-r--r-- | atuin-client/src/record/sqlite_store.rs | 6 | ||||
| -rw-r--r-- | atuin-client/src/record/store.rs | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/atuin-client/src/record/sqlite_store.rs b/atuin-client/src/record/sqlite_store.rs index 4e4a3756..e5e3b9cd 100644 --- a/atuin-client/src/record/sqlite_store.rs +++ b/atuin-client/src/record/sqlite_store.rs @@ -154,6 +154,12 @@ impl Store for SqliteStore { Ok(()) } + async fn delete_all(&self) -> Result<()> { + sqlx::query("delete from store").execute(&self.pool).await?; + + Ok(()) + } + async fn last(&self, host: HostId, tag: &str) -> Result<Option<Record<EncryptedData>>> { let res = sqlx::query("select * from store where host=?1 and tag=?2 order by idx desc limit 1") diff --git a/atuin-client/src/record/store.rs b/atuin-client/src/record/store.rs index 1d812549..ae8ea356 100644 --- a/atuin-client/src/record/store.rs +++ b/atuin-client/src/record/store.rs @@ -21,7 +21,9 @@ pub trait Store { ) -> Result<()>; async fn get(&self, id: RecordId) -> Result<Record<EncryptedData>>; + async fn delete(&self, id: RecordId) -> Result<()>; + async fn delete_all(&self) -> Result<()>; async fn len(&self, host: HostId, tag: &str) -> Result<u64>; async fn len_tag(&self, tag: &str) -> Result<u64>; |
