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

Function catalog_statement

graphlite/src/ast/parser.rs:2598–2626  ·  view source on GitHub ↗

Parse catalog statement (DDL operations)

(tokens: &[Token])

Source from the content-addressed store, hash-verified

2596
2597/// Parse catalog statement (DDL operations)
2598fn catalog_statement(tokens: &[Token]) -> IResult<&[Token], CatalogStatement> {
2599 alt((
2600 map(create_schema_statement, CatalogStatement::CreateSchema),
2601 map(drop_schema_statement, CatalogStatement::DropSchema),
2602 // IMPORTANT: Parse CREATE/DROP/ALTER GRAPH TYPE before CREATE/DROP GRAPH
2603 // because "CREATE GRAPH" would match "CREATE GRAPH TYPE" prematurely
2604 map(
2605 create_graph_type_statement,
2606 CatalogStatement::CreateGraphType,
2607 ),
2608 map(drop_graph_type_statement, CatalogStatement::DropGraphType),
2609 map(alter_graph_type_statement, CatalogStatement::AlterGraphType),
2610 map(create_graph_statement, CatalogStatement::CreateGraph),
2611 map(drop_graph_statement, CatalogStatement::DropGraph),
2612 map(truncate_graph_statement, CatalogStatement::TruncateGraph),
2613 map(clear_graph_statement, CatalogStatement::ClearGraph),
2614 map(create_user_statement, CatalogStatement::CreateUser),
2615 map(drop_user_statement, CatalogStatement::DropUser),
2616 map(create_role_statement, CatalogStatement::CreateRole),
2617 map(drop_role_statement, CatalogStatement::DropRole),
2618 map(grant_role_statement, CatalogStatement::GrantRole),
2619 map(revoke_role_statement, CatalogStatement::RevokeRole),
2620 map(
2621 create_procedure_statement,
2622 CatalogStatement::CreateProcedure,
2623 ),
2624 map(drop_procedure_statement, CatalogStatement::DropProcedure),
2625 ))(tokens)
2626}
2627
2628/// Parse and validate schema name (catalog path with validation for schema names)
2629fn validated_schema_name(tokens: &[Token]) -> IResult<&[Token], CatalogPath> {

Callers 1

parse_queryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected