MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / extract_sql_callee

Function extract_sql_callee

internal/cbm/extract_calls.c:673–683  ·  view source on GitHub ↗

SQL: an `invocation` node's callee is nested object_reference > `name` field (the same shape as a create_function's name).

Source from the content-addressed store, hash-verified

671// SQL: an `invocation` node's callee is nested object_reference > `name` field
672// (the same shape as a create_function's name).
673static char *extract_sql_callee(CBMArena *a, TSNode node, const char *source, const char *nk) {
674 if (strcmp(nk, "invocation") != 0) {
675 return NULL;
676 }
677 TSNode oref = cbm_find_child_by_kind(node, "object_reference");
678 if (ts_node_is_null(oref)) {
679 return NULL;
680 }
681 TSNode nm = ts_node_child_by_field_name(oref, TS_FIELD("name"));
682 return ts_node_is_null(nm) ? NULL : cbm_node_text(a, nm, source);
683}
684
685// COBOL: a `CALL 'HELPER'` is a call_statement whose `x` field is a string
686// literal naming the called program; the callee is that string sans quotes.

Callers 1

Calls 2

cbm_find_child_by_kindFunction · 0.85
cbm_node_textFunction · 0.85

Tested by

no test coverage detected