use crate::fact::{Entity, EntityId, Relationship, RelationshipId, SubGraph};
use crate::scope::Scope;
use crate::store::MemoryError;
use async_trait::async_trait;
use chrono::{DateTime, Utc};
#[async_trait]
pub trait GraphStore: Send + Sync {
async fn upsert_entity(&self, entity: &Entity) -> Result<(), MemoryError>;
async fn upsert_relationship(&self, rel: &Relationship) -> Result<(), MemoryError>;
async fn invalidate_relationship(
&self,
id: RelationshipId,
invalid_at: DateTime<Utc>,
) -> Result<(), MemoryError>;
async fn get_entity(&self, id: EntityId) -> Result<Option<Entity>, MemoryError>;
async fn neighbors(
&self,
id: EntityId,
depth: u8,
as_of: Option<DateTime<Utc>>,
) -> Result<SubGraph, MemoryError>;
async fn search_entities(&self, query: &str, top_k: usize) -> Result<Vec<Entity>, MemoryError>;
async fn delete_by_scope(&self, scope: &Scope) -> Result<u64, MemoryError>;
}