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

Function validate_create_schema_statement

graphlite/src/ast/validator.rs:2659–2677  ·  view source on GitHub ↗

Validate CREATE SCHEMA statement

(
    create_schema: &CreateSchemaStatement,
    errors: &mut Vec<ValidationError>,
)

Source from the content-addressed store, hash-verified

2657
2658/// Validate CREATE SCHEMA statement
2659fn validate_create_schema_statement(
2660 create_schema: &CreateSchemaStatement,
2661 errors: &mut Vec<ValidationError>,
2662) {
2663 // Validate schema name is not empty
2664 if create_schema.schema_path.segments.is_empty()
2665 || create_schema
2666 .schema_path
2667 .segments
2668 .iter()
2669 .any(|s| s.trim().is_empty())
2670 {
2671 errors.push(ValidationError {
2672 message: "Invalid schema name".to_string(),
2673 location: Some(create_schema.location.clone()),
2674 error_type: ValidationErrorType::Syntax,
2675 });
2676 }
2677}
2678
2679/// Validate DROP SCHEMA statement
2680fn validate_drop_schema_statement(

Callers 1

Calls 3

cloneMethod · 0.80
is_emptyMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected