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

Function validate_yield_clause

graphlite/src/ast/validator.rs:2314–2329  ·  view source on GitHub ↗

Validate YIELD clause

(yield_clause: &YieldClause, errors: &mut Vec<ValidationError>)

Source from the content-addressed store, hash-verified

2312
2313/// Validate YIELD clause
2314fn validate_yield_clause(yield_clause: &YieldClause, errors: &mut Vec<ValidationError>) {
2315 // Check for duplicate column names/aliases
2316 let mut seen_names = std::collections::HashSet::new();
2317
2318 for item in &yield_clause.items {
2319 let output_name = item.alias.as_ref().unwrap_or(&item.column_name);
2320
2321 if !seen_names.insert(output_name) {
2322 errors.push(ValidationError {
2323 message: format!("Duplicate YIELD column: {}", output_name),
2324 location: Some(item.location.clone()),
2325 error_type: ValidationErrorType::Semantic,
2326 });
2327 }
2328 }
2329}
2330
2331/// Validate SELECT statement
2332fn validate_select_statement(

Callers 1

validate_call_statementFunction · 0.85

Calls 2

cloneMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected