diff options
Diffstat (limited to 'atuin-server-database')
| -rw-r--r-- | atuin-server-database/src/lib.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/atuin-server-database/src/lib.rs b/atuin-server-database/src/lib.rs index de33ba44..cdff90a2 100644 --- a/atuin-server-database/src/lib.rs +++ b/atuin-server-database/src/lib.rs @@ -13,7 +13,10 @@ use self::{ models::{History, NewHistory, NewSession, NewUser, Session, User}, }; use async_trait::async_trait; -use atuin_common::utils::get_days_from_month; +use atuin_common::{ + record::{EncryptedData, HostId, Record, RecordId, RecordIndex}, + utils::get_days_from_month, +}; use chrono::{Datelike, TimeZone}; use chronoutil::RelativeDuration; use serde::{de::DeserializeOwned, Serialize}; @@ -55,6 +58,19 @@ pub trait Database: Sized + Clone + Send + Sync + 'static { async fn delete_history(&self, user: &User, id: String) -> DbResult<()>; async fn deleted_history(&self, user: &User) -> DbResult<Vec<String>>; + async fn add_records(&self, user: &User, record: &[Record<EncryptedData>]) -> DbResult<()>; + async fn next_records( + &self, + user: &User, + host: HostId, + tag: String, + start: Option<RecordId>, + count: u64, + ) -> DbResult<Vec<Record<EncryptedData>>>; + + // Return the tail record ID for each store, so (HostID, Tag, TailRecordID) + async fn tail_records(&self, user: &User) -> DbResult<RecordIndex>; + async fn count_history_range( &self, user: &User, |
