Validate a query within a procedure body - doesn't require RETURN clause
(
query: &Query,
ctx: &ValidationContext,
errors: &mut Vec<ValidationError>,
)
| 2622 | |
| 2623 | /// Validate a query within a procedure body - doesn't require RETURN clause |
| 2624 | fn validate_procedure_query( |
| 2625 | query: &Query, |
| 2626 | ctx: &ValidationContext, |
| 2627 | errors: &mut Vec<ValidationError>, |
| 2628 | ) { |
| 2629 | match query { |
| 2630 | Query::Basic(basic_query) => { |
| 2631 | // Validate structure but don't require RETURN clause |
| 2632 | if basic_query.match_clause.patterns.is_empty() { |
| 2633 | errors.push(ValidationError { |
| 2634 | message: "Query must have at least one path pattern in MATCH clause" |
| 2635 | .to_string(), |
| 2636 | location: None, |
| 2637 | error_type: ValidationErrorType::Structural, |
| 2638 | }); |
| 2639 | } |
| 2640 | // Note: We don't check for RETURN clause requirement here |
| 2641 | |
| 2642 | // Validate other aspects using a temporary context |
| 2643 | let mut temp_ctx = ctx.clone(); |
| 2644 | |
| 2645 | // Validate variable declarations and patterns |
| 2646 | validate_basic_query_variables(basic_query, &mut temp_ctx, errors); |
| 2647 | validate_basic_query_path_patterns(basic_query, &mut temp_ctx, errors); |
| 2648 | validate_basic_query_expressions(basic_query, &mut temp_ctx, errors); |
| 2649 | } |
| 2650 | _ => { |
| 2651 | // For other query types, use standard validation for now |
| 2652 | // This is a simplified implementation - in production you'd want full validation |
| 2653 | // without RETURN clause requirements |
| 2654 | } |
| 2655 | } |
| 2656 | } |
| 2657 | |
| 2658 | /// Validate CREATE SCHEMA statement |
| 2659 | fn validate_create_schema_statement( |
no test coverage detected