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

Function execute_default_projection

src/cypher/cypher.c:4152–4173  ·  view source on GitHub ↗

Default projection when no RETURN clause */

Source from the content-addressed store, hash-verified

4150
4151/* Default projection when no RETURN clause */
4152static void execute_default_projection(cbm_pattern_t *pat0, binding_t *bindings, int bind_count,
4153 int max_rows, result_builder_t *rb) {
4154 const char *vars[CYP_MAX_VARS];
4155 int vc = 0;
4156 for (int ni = 0; ni < pat0->node_count && vc < CYP_MAX_VARS; ni++) {
4157 if (pat0->nodes[ni].variable) {
4158 vars[vc++] = pat0->nodes[ni].variable;
4159 }
4160 }
4161 build_default_columns(rb, vars, vc);
4162 for (int bi = 0; bi < bind_count && rb->row_count < max_rows; bi++) {
4163 const char *vals[CYP_COL_BUF];
4164 for (int v = 0; v < vc; v++) {
4165 cbm_node_t *n = binding_get(&bindings[bi], vars[v]);
4166 vals[(size_t)v * CYP_EDGE_COLS] = n && n->name ? n->name : "";
4167 vals[((size_t)v * CYP_EDGE_COLS) + SKIP_ONE] =
4168 n && n->qualified_name ? n->qualified_name : "";
4169 vals[((size_t)v * CYP_EDGE_COLS) + PAIR_LEN] = n && n->label ? n->label : "";
4170 }
4171 rb_add_row(rb, vals);
4172 }
4173}
4174
4175/* Cross-join node-only pattern into existing bindings */
4176static void cross_join_nodes(binding_t **bindings, int *bind_count, cbm_node_t *extra_nodes,

Callers 1

execute_singleFunction · 0.85

Calls 3

build_default_columnsFunction · 0.85
binding_getFunction · 0.85
rb_add_rowFunction · 0.85

Tested by

no test coverage detected