| 283 | } |
| 284 | |
| 285 | static 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 | |
| 311 | static bool db_sqlite3_step(struct db_stmt *stmt) |
| 312 | { |
nothing calls this directly
no test coverage detected