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

Function dm_count

tests/test_doc_mentions_helpers.h:131–144  ·  view source on GitHub ↗

The single integer a query returns; -1 when it cannot be read. */

Source from the content-addressed store, hash-verified

129
130/* The single integer a query returns; -1 when it cannot be read. */
131static inline int dm_count(const char *db, const char *sql) {
132 sqlite3 *h = NULL;
133 int n = -1;
134 if (sqlite3_open_v2(db, &h, SQLITE_OPEN_READONLY, NULL) == SQLITE_OK) {
135 sqlite3_stmt *st = NULL;
136 if (sqlite3_prepare_v2(h, sql, -1, &st, NULL) == SQLITE_OK &&
137 sqlite3_step(st) == SQLITE_ROW) {
138 n = sqlite3_column_int(st, 0);
139 }
140 sqlite3_finalize(st);
141 }
142 sqlite3_close(h);
143 return n;
144}
145
146/* Reason (and, when `syntax` is not NULL, the family name) of the unresolved
147 * row with this raw text in this file; "" when there is none. */

Callers 15

md_supersedes_fromFunction · 0.85
md_supersedes_syntaxFunction · 0.85
jt_rowsFunction · 0.85
rst_rowsFunction · 0.85
dm_namespace_publishedFunction · 0.85
dm_control_publishedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected