Helper function to prepare a statement
| 32 | |
| 33 | // Helper function to prepare a statement |
| 34 | sqlite3_stmt* prepareStatement(sqlite3* db, const std::string& sql) |
| 35 | { |
| 36 | sqlite3_stmt* stmt = nullptr; |
| 37 | const int rc = sqlite3_prepare_v2(db, sql.c_str(), -1, &stmt, nullptr); |
| 38 | if(rc != SQLITE_OK) |
| 39 | { |
| 40 | throw RuntimeError(std::string("Failed to prepare statement: ") + sqlite3_errmsg(db)); |
| 41 | } |
| 42 | return stmt; |
| 43 | } |
| 44 | |
| 45 | // Helper function to execute a prepared statement |
| 46 | void execStatement(sqlite3_stmt* stmt) |
no test coverage detected