| 2386 | } |
| 2387 | |
| 2388 | int cbm_store_count_edges(cbm_store_t *s, const char *project) { |
| 2389 | if (!s || !s->db) { |
| 2390 | return 0; |
| 2391 | } |
| 2392 | sqlite3_stmt *stmt = |
| 2393 | prepare_cached(s, &s->stmt_count_edges, "SELECT COUNT(*) FROM edges WHERE project = ?1;"); |
| 2394 | if (!stmt) { |
| 2395 | return CBM_STORE_ERR; |
| 2396 | } |
| 2397 | |
| 2398 | bind_text(stmt, SKIP_ONE, project); |
| 2399 | int count = 0; |
| 2400 | if (sqlite3_step(stmt) == SQLITE_ROW) { |
| 2401 | count = sqlite3_column_int(stmt, 0); |
| 2402 | } |
| 2403 | sqlite3_reset(stmt); |
| 2404 | return count; |
| 2405 | } |
| 2406 | |
| 2407 | int cbm_store_count_edges_by_type(cbm_store_t *s, const char *project, const char *type) { |
| 2408 | sqlite3_stmt *stmt = |