The single integer a query returns; -1 when it cannot be read. */
| 129 | |
| 130 | /* The single integer a query returns; -1 when it cannot be read. */ |
| 131 | static 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. */ |
no outgoing calls
no test coverage detected