kotoba_execution/execution/
executor.rs1use kotoba_storage::KeyValueStore;
4use std::collections::HashMap;
5use std::sync::Arc;
6use tracing::warn;
7
8type Result<T> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync>>;
10
11#[derive(Debug)]
13pub struct QueryExecutor<T: KeyValueStore + 'static> {
14 storage: Arc<T>,
15}
16
17impl<T: KeyValueStore + 'static> QueryExecutor<T> {
18 pub fn new(storage: Arc<T>) -> Self {
19 Self { storage }
20 }
21
22 pub async fn execute_gql(&self, gql: &str, context: &HashMap<String, serde_json::Value>) -> Result<Vec<serde_json::Value>> {
24 warn!("GQL execution not fully implemented yet");
26 Ok(vec![])
27 }
28
29 pub async fn execute_plan(&self, plan: &str, context: &HashMap<String, serde_json::Value>) -> Result<Vec<serde_json::Value>> {
31 warn!("Plan execution not implemented yet");
33 Ok(vec![])
34 }
35
36 pub async fn execute_physical_plan(&self, plan: &str, context: &HashMap<String, serde_json::Value>) -> Result<Vec<serde_json::Value>> {
38 warn!("Physical plan execution not implemented yet");
40 Ok(vec![])
41 }
42
43 pub fn evaluate_expr(&self, row: &HashMap<String, serde_json::Value>, expr: &str) -> Result<serde_json::Value> {
45 warn!("Expression evaluation not implemented yet");
47 Ok(serde_json::Value::Null)
48 }
49}