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

Function validated_schema_name

graphlite/src/ast/parser.rs:2629–2643  ·  view source on GitHub ↗

Parse and validate schema name (catalog path with validation for schema names)

(tokens: &[Token])

Source from the content-addressed store, hash-verified

2627
2628/// Parse and validate schema name (catalog path with validation for schema names)
2629fn validated_schema_name(tokens: &[Token]) -> IResult<&[Token], CatalogPath> {
2630 // First parse as a regular catalog path
2631 let (remaining, schema_path) = catalog_path(tokens)?;
2632
2633 // Validate schema name is not empty
2634 if schema_path.segments.is_empty() || schema_path.segments.iter().any(|s| s.trim().is_empty()) {
2635 // Return a custom error that will be converted to "Invalid schema name"
2636 return Err(nom::Err::Failure(nom::error::Error::new(
2637 tokens,
2638 nom::error::ErrorKind::Verify,
2639 )));
2640 }
2641
2642 Ok((remaining, schema_path))
2643}
2644
2645/// Parse CREATE SCHEMA statement
2646fn create_schema_statement(tokens: &[Token]) -> IResult<&[Token], CreateSchemaStatement> {

Callers

nothing calls this directly

Calls 3

catalog_pathFunction · 0.85
is_emptyMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected