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

Function collect_pattern_vars

src/cypher/cypher.c:3809–3824  ·  view source on GitHub ↗

Project RETURN * — all bound variable properties */ Collect all variable names from query patterns */

Source from the content-addressed store, hash-verified

3807/* Project RETURN * — all bound variable properties */
3808/* Collect all variable names from query patterns */
3809static int collect_pattern_vars(cbm_query_t *q, const char **vars, int max_vars) {
3810 int vc = 0;
3811 for (int pi = 0; pi < q->pattern_count; pi++) {
3812 for (int ni = 0; ni < q->patterns[pi].node_count && vc < max_vars; ni++) {
3813 if (q->patterns[pi].nodes[ni].variable) {
3814 vars[vc++] = q->patterns[pi].nodes[ni].variable;
3815 }
3816 }
3817 for (int ri = 0; ri < q->patterns[pi].rel_count && vc < max_vars; ri++) {
3818 if (q->patterns[pi].rels[ri].variable) {
3819 vars[vc++] = q->patterns[pi].rels[ri].variable;
3820 }
3821 }
3822 }
3823 return vc;
3824}
3825
3826/* Build star-projection columns: var.name, var.qualified_name, var.label, var.file_path */
3827static void build_star_columns(result_builder_t *rb, const char **vars, int vc) {

Callers 1

execute_return_starFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected