nova_boot_graphdb/
traits.rs1use crate::{error::GraphDbError, types::*};
2use async_trait::async_trait;
3use serde_json::Value as JsonValue;
4
5#[async_trait]
9pub trait GraphStore: Send + Sync {
10 async fn execute(&self, query: GraphQuery) -> Result<JsonValue, GraphDbError>;
12
13 async fn upsert_node(&self, node: GraphNode) -> Result<(), GraphDbError>;
15
16 async fn upsert_edge(&self, edge: GraphEdge) -> Result<(), GraphDbError>;
18
19 async fn get_node(&self, node_id: &str) -> Result<Option<GraphNode>, GraphDbError>;
21
22 async fn neighbors(&self, node_id: &str) -> Result<Vec<GraphNode>, GraphDbError>;
24
25 async fn traverse(&self, start: &str, max_depth: usize) -> Result<GraphSubgraph, GraphDbError>;
27}