MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / validate_procedure_statement

Function validate_procedure_statement

graphlite/src/ast/validator.rs:2570–2596  ·  view source on GitHub ↗

Validate a statement within a procedure body context In procedure bodies, statements have different validation rules: - MATCH statements don't require RETURN clauses when followed by NEXT - Data statements (like DELETE) don't require RETURN clauses

(
    statement: &Statement,
    ctx: &ValidationContext,
    errors: &mut Vec<ValidationError>,
)

Source from the content-addressed store, hash-verified

2568/// - MATCH statements don't require RETURN clauses when followed by NEXT
2569/// - Data statements (like DELETE) don't require RETURN clauses
2570fn validate_procedure_statement(
2571 statement: &Statement,
2572 ctx: &ValidationContext,
2573 errors: &mut Vec<ValidationError>,
2574) {
2575 match statement {
2576 Statement::Query(query) => {
2577 // For query statements in procedure bodies, validate without requiring RETURN clause
2578 validate_procedure_query(query, ctx, errors);
2579 }
2580 Statement::DataStatement(_data_stmt) => {
2581 // Data statements (like DELETE) in procedure bodies don't require RETURN clauses
2582 // Just validate that the statement structure is valid, but don't require RETURN
2583 // TODO: Implement basic data statement validation without RETURN requirement
2584 }
2585 _ => {
2586 // For other statement types, use general validation
2587 let doc = Document {
2588 statement: statement.clone(),
2589 location: Default::default(),
2590 };
2591 if let Err(mut nested_errors) = validate_query(&doc, ctx.has_graph_context) {
2592 errors.append(&mut nested_errors);
2593 }
2594 }
2595 }
2596}
2597
2598/// Validate catalog statement (DDL operations)
2599fn validate_catalog_statement(

Callers 1

validate_queryFunction · 0.85

Calls 3

validate_procedure_queryFunction · 0.85
validate_queryFunction · 0.85
cloneMethod · 0.80

Tested by

no test coverage detected