Create Google datastore adaptor

This commit is contained in:
Ben Grant 2023-05-15 15:28:17 +10:00
parent 2da5ba107f
commit 4abb538db7
7 changed files with 621 additions and 21 deletions

View file

@ -15,8 +15,8 @@ pub trait Adaptor: Send + Sync {
type Error: Error;
async fn get_stats(&self) -> Result<Stats, Self::Error>;
async fn increment_stat_event_count(&self) -> Result<i32, Self::Error>;
async fn increment_stat_person_count(&self) -> Result<i32, Self::Error>;
async fn increment_stat_event_count(&self) -> Result<i64, Self::Error>;
async fn increment_stat_person_count(&self) -> Result<i64, Self::Error>;
async fn get_people(&self, event_id: String) -> Result<Option<Vec<Person>>, Self::Error>;
async fn upsert_person(&self, event_id: String, person: Person) -> Result<Person, Self::Error>;

View file

@ -1,4 +1,4 @@
pub struct Stats {
pub event_count: i32,
pub person_count: i32,
pub event_count: i64,
pub person_count: i64,
}