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

Function validate_subquery

graphlite/src/ast/validator.rs:2539–2564  ·  view source on GitHub ↗

Validate a subquery recursively

(
    query: &Query,
    ctx: &mut ValidationContext,
    errors: &mut Vec<ValidationError>,
)

Source from the content-addressed store, hash-verified

2537
2538/// Validate a subquery recursively
2539fn validate_subquery(
2540 query: &Query,
2541 ctx: &mut ValidationContext,
2542 errors: &mut Vec<ValidationError>,
2543) {
2544 // Create a new context scope for the subquery to avoid variable leakage
2545 let mut subquery_ctx = ctx.clone();
2546
2547 // Validate the query structure
2548 validate_query_structure(query, errors);
2549
2550 // Validate variable declarations and scope within subquery
2551 validate_variable_declarations(query, &mut subquery_ctx, errors);
2552
2553 // Validate path patterns within subquery
2554 validate_path_patterns(query, &mut subquery_ctx, errors);
2555
2556 // Validate expressions within subquery
2557 validate_expressions(query, &mut subquery_ctx, errors);
2558
2559 // Validate temporal literals within subquery
2560 validate_temporal_literals(query, errors);
2561
2562 // Validate edge patterns within subquery
2563 validate_edge_patterns(query, errors);
2564}
2565
2566/// Validate a statement within a procedure body context
2567/// In procedure bodies, statements have different validation rules:

Callers 1

validate_expressionFunction · 0.85

Calls 7

validate_query_structureFunction · 0.85
validate_path_patternsFunction · 0.85
validate_expressionsFunction · 0.85
validate_edge_patternsFunction · 0.85
cloneMethod · 0.80

Tested by

no test coverage detected