MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / _AST_ExtractQueryString

Function _AST_ExtractQueryString

src/ast/ast.c:646–658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644}
645
646const char *_AST_ExtractQueryString
647(
648 const cypher_parse_result_t *partial_result
649) {
650 // Retrieve the AST root node from a parsed query.
651 const cypher_astnode_t *statement = _AST_parse_result_root(partial_result);
652 // We are parsing with the CYPHER_PARSE_ONLY_PARAMETERS flag.
653 // Given that, only the parameters were processed. extract the actual query and return to caller.
654 ASSERT(cypher_astnode_type(statement) == CYPHER_AST_STATEMENT);
655 const cypher_astnode_t *body = cypher_ast_statement_get_body(statement);
656 ASSERT(cypher_astnode_type(body) == CYPHER_AST_STRING);
657 return cypher_ast_string_get_value(body);
658}
659
660inline AST_AnnotationCtxCollection *AST_GetAnnotationCtxCollection
661(

Callers 1

parse_paramsFunction · 0.85

Calls 1

_AST_parse_result_rootFunction · 0.85

Tested by

no test coverage detected