| 59 | } |
| 60 | |
| 61 | static void SetPragma(sqlite3* db, const std::string& key, const std::string& value, const std::string& err_msg) |
| 62 | { |
| 63 | std::string stmt_text = strprintf("PRAGMA %s = %s", key, value); |
| 64 | int ret = sqlite3_exec(db, stmt_text.c_str(), nullptr, nullptr, nullptr); |
| 65 | if (ret != SQLITE_OK) { |
| 66 | throw std::runtime_error(strprintf("SQLiteDatabase: %s: %s\n", err_msg, sqlite3_errstr(ret))); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | SQLiteDatabase::SQLiteDatabase(const fs::path& dir_path, const fs::path& file_path, bool mock) |
| 71 | : WalletDatabase(), m_mock(mock), m_dir_path(fs::PathToString(dir_path)), m_file_path(fs::PathToString(file_path)) |