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

Function compare_open_project_store

src/mcp/mcp.c:3105–3118  ·  view source on GitHub ↗

compare_graphs deliberately bypasses resolve_store(): it needs two * independently-owned request-scoped read handles, while resolve_store caches * one handle on the server. Direct-name lookup stays the fast path; the * existing internal-name fallback preserves legacy renamed databases. */

Source from the content-addressed store, hash-verified

3103 * one handle on the server. Direct-name lookup stays the fast path; the
3104 * existing internal-name fallback preserves legacy renamed databases. */
3105static cbm_store_t *compare_open_project_store(const char *project) {
3106 char path[CBM_SZ_1K];
3107 project_db_path(project, path, sizeof(path));
3108 cbm_store_t *store = path[0] ? cbm_store_open_path_query(path) : NULL;
3109 if (store) {
3110 cbm_project_t row = {0};
3111 if (cbm_store_get_project(store, project, &row) == CBM_STORE_OK) {
3112 cbm_project_free_fields(&row);
3113 return store;
3114 }
3115 cbm_store_close(store);
3116 }
3117 return resolve_store_fallback_scan(project);
3118}
3119
3120typedef struct {
3121 yyjson_mut_val *items;

Callers 1

handle_compare_graphsFunction · 0.85

Calls 6

project_db_pathFunction · 0.85
cbm_store_get_projectFunction · 0.85
cbm_project_free_fieldsFunction · 0.85
cbm_store_closeFunction · 0.85

Tested by

no test coverage detected