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

Function execute_default_projection

src/cypher/cypher.c:4500–4521  ·  view source on GitHub ↗

Default projection when no RETURN clause */

Source from the content-addressed store, hash-verified

4498
4499/* Default projection when no RETURN clause */
4500static void execute_default_projection(cbm_pattern_t *pat0, binding_t *bindings, int bind_count,
4501 int max_rows, result_builder_t *rb) {
4502 const char *vars[CYP_MAX_VARS];
4503 int vc = 0;
4504 for (int ni = 0; ni < pat0->node_count && vc < CYP_MAX_VARS; ni++) {
4505 if (pat0->nodes[ni].variable) {
4506 vars[vc++] = pat0->nodes[ni].variable;
4507 }
4508 }
4509 build_default_columns(rb, vars, vc);
4510 for (int bi = 0; bi < bind_count && rb->row_count < max_rows; bi++) {
4511 const char *vals[CYP_COL_BUF];
4512 for (int v = 0; v < vc; v++) {
4513 cbm_node_t *n = binding_get(&bindings[bi], vars[v]);
4514 vals[(size_t)v * CYP_EDGE_COLS] = n && n->name ? n->name : "";
4515 vals[((size_t)v * CYP_EDGE_COLS) + SKIP_ONE] =
4516 n && n->qualified_name ? n->qualified_name : "";
4517 vals[((size_t)v * CYP_EDGE_COLS) + PAIR_LEN] = n && n->label ? n->label : "";
4518 }
4519 rb_add_row(rb, vals);
4520 }
4521}
4522
4523/* Worst-case binding_t slot count for a node cross-join: one row per
4524 * (existing binding × extra node), plus — for an OPTIONAL join with no extra

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