MCPcopy Index your code
hub / github.com/antirez/botlib / sqlInsert

Function sqlInsert

sqlite_wrap.c:171–179  ·  view source on GitHub ↗

Wrapper for sqlGenericQuery() returning the last inserted ID or 0 * on error. */

Source from the content-addressed store, hash-verified

169/* Wrapper for sqlGenericQuery() returning the last inserted ID or 0
170 * on error. */
171int sqlInsert(sqlite3 *dbhandle, const char *sql, ...) {
172 int64_t lastid = 0;
173 va_list ap;
174 va_start(ap,sql);
175 int rc = sqlGenericQuery(dbhandle,NULL,sql,ap);
176 if (rc == SQLITE_DONE) lastid = sqlite3_last_insert_rowid(dbhandle);
177 va_end(ap);
178 return lastid;
179}
180
181/* Wrapper for sqlGenericQuery() returning 1 if the query resulted in
182 * SQLITE_DONE, otherwise zero. This is good for UPDATE and DELETE

Callers 1

kvSetLenFunction · 0.85

Calls 1

sqlGenericQueryFunction · 0.85

Tested by

no test coverage detected