ROADMAP v0.5.0 - Function call execution
(
&self,
func_name: &str,
arg_values: &[Value],
context: &ExecutionContext,
)
| 8305 | /// Execute a function call (delegates to existing function registry) |
| 8306 | #[allow(dead_code)] // ROADMAP v0.5.0 - Function call execution |
| 8307 | fn execute_function_call( |
| 8308 | &self, |
| 8309 | func_name: &str, |
| 8310 | arg_values: &[Value], |
| 8311 | context: &ExecutionContext, |
| 8312 | ) -> Result<Value, ExecutionError> { |
| 8313 | // DEBUG: Log the context state before creating function context |
| 8314 | log::debug!(" Function name: '{}'", func_name); |
| 8315 | log::debug!( |
| 8316 | " Context has storage_manager: {}", |
| 8317 | context.storage_manager.is_some() |
| 8318 | ); |
| 8319 | log::debug!( |
| 8320 | " Context has current_graph: {}", |
| 8321 | context.current_graph.is_some() |
| 8322 | ); |
| 8323 | log::debug!(" Context session_id: '{}'", context.session_id); |
| 8324 | log::debug!( |
| 8325 | " Context get_current_graph_name(): {:?}", |
| 8326 | context.get_current_graph_name() |
| 8327 | ); |
| 8328 | |
| 8329 | // Create a function context with storage access |
| 8330 | let func_context = FunctionContext::with_storage( |
| 8331 | vec![], // No input rows for simple function calls |
| 8332 | context.variables.clone(), |
| 8333 | arg_values.to_vec(), |
| 8334 | context.storage_manager.clone(), |
| 8335 | context.current_graph.clone(), |
| 8336 | context.get_current_graph_name(), |
| 8337 | ); |
| 8338 | |
| 8339 | // DEBUG: Verify what we passed to function context |
| 8340 | log::debug!(" FunctionContext created with:"); |
| 8341 | log::debug!( |
| 8342 | " storage_manager: {}", |
| 8343 | func_context.storage_manager.is_some() |
| 8344 | ); |
| 8345 | log::debug!( |
| 8346 | " current_graph: {}", |
| 8347 | func_context.current_graph.is_some() |
| 8348 | ); |
| 8349 | log::debug!(" graph_name: {:?}", func_context.graph_name); |
| 8350 | |
| 8351 | // Execute using the existing function registry |
| 8352 | match self.function_registry.get(func_name) { |
| 8353 | Some(function) => function.execute(&func_context).map_err(|e| { |
| 8354 | ExecutionError::RuntimeError(format!("Function execution error: {}", e)) |
| 8355 | }), |
| 8356 | None => Err(ExecutionError::RuntimeError(format!( |
| 8357 | "Unknown function: {}", |
| 8358 | func_name |
| 8359 | ))), |
| 8360 | } |
| 8361 | } |
| 8362 | |
| 8363 | /// Evaluate a unary operation |
| 8364 | fn evaluate_unary_op( |
no test coverage detected