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

Function navigation_probe_count

tests/test_pipeline.c:10649–10673  ·  view source on GitHub ↗

A failed SQL query must never look like an absent false edge. */

Source from the content-addressed store, hash-verified

10647
10648/* A failed SQL query must never look like an absent false edge. */
10649static int navigation_probe_count(cbm_store_t *store, const char *sql, const char *project,
10650 const char *value, const char *source_name) {
10651 sqlite3_stmt *st = NULL;
10652 sqlite3 *db = cbm_store_get_db(store);
10653 if (!db || sqlite3_prepare_v2(db, sql, -1, &st, NULL) != SQLITE_OK) {
10654 sqlite3_finalize(st);
10655 return -1;
10656 }
10657 int count = -1;
10658 bool bound = sqlite3_bind_text(st, 1, project, -1, SQLITE_TRANSIENT) == SQLITE_OK &&
10659 sqlite3_bind_text(st, 2, value, -1, SQLITE_TRANSIENT) == SQLITE_OK;
10660 if (bound && source_name) {
10661 bound = sqlite3_bind_text(st, 3, source_name, -1, SQLITE_TRANSIENT) == SQLITE_OK;
10662 }
10663 if (bound && sqlite3_step(st) == SQLITE_ROW) {
10664 count = sqlite3_column_int(st, 0);
10665 if (sqlite3_step(st) != SQLITE_DONE) {
10666 count = -1;
10667 }
10668 }
10669 if (sqlite3_finalize(st) != SQLITE_OK) {
10670 count = -1;
10671 }
10672 return count;
10673}
10674
10675/* #1250: exercise the generic URL heuristic with real extracted occurrences
10676 * and real source nodes. More than 50 files selects the parallel resolver.

Callers 1

test_pipeline.cFile · 0.85

Calls 1

cbm_store_get_dbFunction · 0.85

Tested by

no test coverage detected