Parse and validate schema name (catalog path with validation for schema names)
(tokens: &[Token])
| 2627 | |
| 2628 | /// Parse and validate schema name (catalog path with validation for schema names) |
| 2629 | fn 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 |
| 2646 | fn create_schema_statement(tokens: &[Token]) -> IResult<&[Token], CreateSchemaStatement> { |
nothing calls this directly
no test coverage detected