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

Function data_statement

graphlite/src/ast/parser.rs:3916–3937  ·  view source on GitHub ↗

Parse data modification statements (INSERT, MATCH INSERT, SET, REMOVE, DELETE)

(tokens: &[Token])

Source from the content-addressed store, hash-verified

3914
3915/// Parse data modification statements (INSERT, MATCH INSERT, SET, REMOVE, DELETE)
3916fn data_statement(tokens: &[Token]) -> IResult<&[Token], DataStatement> {
3917 log::debug!(
3918 "data_statement called with tokens: {:?}",
3919 tokens.get(0..3).unwrap_or(&[])
3920 );
3921 let result = alt((
3922 // Try MATCH-* patterns first (more specific)
3923 map(match_insert_statement, DataStatement::MatchInsert),
3924 map(match_set_statement, DataStatement::MatchSet),
3925 map(match_remove_statement, DataStatement::MatchRemove),
3926 map(match_delete_statement, DataStatement::MatchDelete),
3927 // Then try standalone patterns
3928 map(insert_statement, DataStatement::Insert),
3929 map(set_statement, DataStatement::Set),
3930 map(remove_statement, DataStatement::Remove),
3931 map(delete_statement, DataStatement::Delete),
3932 ))(tokens);
3933 if result.is_err() {
3934 log::debug!("data_statement parsing failed");
3935 }
3936 result
3937}
3938
3939/// Parse MATCH INSERT statement: MATCH pattern... [WITH ...] [WHERE condition] INSERT graph_pattern [, graph_pattern]*
3940fn match_insert_statement(tokens: &[Token]) -> IResult<&[Token], MatchInsertStatement> {

Callers 1

parse_queryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected