MCPcopy Create free account
hub / github.com/ElementsProject/lightning / db_sqlite3_exec

Function db_sqlite3_exec

db/db_sqlite3.c:285–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285static bool db_sqlite3_exec(struct db_stmt *stmt)
286{
287 int err;
288 char *expanded_sql;
289 struct db_sqlite3 *wrapper = (struct db_sqlite3 *) stmt->db->conn;
290
291 if (!db_sqlite3_query(stmt)) {
292 /* If the prepare step caused an error we hand it up. */
293 return false;
294 }
295
296 err = sqlite3_step(stmt->inner_stmt);
297 if (err != SQLITE_DONE) {
298 tal_free(stmt->error);
299 stmt->error = db_sqlite3_fmt_error(stmt);
300 return false;
301 }
302
303 /* Manually expand and call the callback */
304 expanded_sql = sqlite3_expanded_sql(stmt->inner_stmt);
305 db_sqlite3_changes_add(wrapper, stmt, expanded_sql);
306 sqlite3_free(expanded_sql);
307
308 return true;
309}
310
311static bool db_sqlite3_step(struct db_stmt *stmt)
312{

Callers

nothing calls this directly

Calls 4

db_sqlite3_queryFunction · 0.85
tal_freeFunction · 0.85
db_sqlite3_fmt_errorFunction · 0.85
db_sqlite3_changes_addFunction · 0.85

Tested by

no test coverage detected