MCPcopy Create free account
hub / github.com/antirez/botlib / sqlSelectOneRow

Function sqlSelectOneRow

sqlite_wrap.c:208–215  ·  view source on GitHub ↗

Wrapper for sqlGenericQuery() using variable number of args. * This is what you want when doing SELECT queries that return a * single row. This function will care to also call sqlNextRow() for * you in case the return value is SQLITE_ROW. */

Source from the content-addressed store, hash-verified

206 * single row. This function will care to also call sqlNextRow() for
207 * you in case the return value is SQLITE_ROW. */
208int sqlSelectOneRow(sqlite3 *dbhandle, sqlRow *row, const char *sql, ...) {
209 va_list ap;
210 va_start(ap,sql);
211 int rc = sqlGenericQuery(dbhandle,row,sql,ap);
212 if (rc == SQLITE_ROW) sqlNextRow(row);
213 va_end(ap);
214 return rc;
215}
216
217/* Wrapper for sqlGenericQuery() to do a SELECT and return directly
218 * the integer of the first row, or zero on error. */

Callers

nothing calls this directly

Calls 2

sqlGenericQueryFunction · 0.85
sqlNextRowFunction · 0.85

Tested by

no test coverage detected