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

Function graph_prepare_node_cursor

src/store/store.c:2001–2019  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1999}
2000
2001static int graph_prepare_node_cursor(cbm_store_t *store, const char *project,
2002 graph_node_cursor_t *cursor) {
2003 static const char sql[] =
2004 "SELECT qualified_name,label,replace(coalesce(file_path,''),'\\','/') "
2005 "FROM nodes WHERE project=?1 "
2006 "ORDER BY qualified_name COLLATE BINARY,label COLLATE BINARY,"
2007 "replace(coalesce(file_path,''),'\\','/') COLLATE BINARY;";
2008 if (sqlite3_prepare_v2(store->db, sql, CBM_NOT_FOUND, &cursor->stmt, NULL) != SQLITE_OK) {
2009 store_set_error_sqlite(store, "compare node prepare");
2010 return CBM_STORE_ERR;
2011 }
2012 if (graph_compare_bind_text(cursor->stmt, SKIP_ONE, project) != SQLITE_OK) {
2013 store_set_error(store, "compare node bind failed");
2014 sqlite3_finalize(cursor->stmt);
2015 cursor->stmt = NULL;
2016 return CBM_STORE_ERR;
2017 }
2018 return graph_node_cursor_step(store, cursor);
2019}
2020
2021static int graph_prepare_edge_cursor(cbm_store_t *store, const char *project,
2022 graph_edge_cursor_t *cursor) {

Callers 1

graph_compare_nodesFunction · 0.85

Calls 4

store_set_error_sqliteFunction · 0.85
graph_compare_bind_textFunction · 0.85
store_set_errorFunction · 0.85
graph_node_cursor_stepFunction · 0.85

Tested by

no test coverage detected