MCPcopy Create free account
hub / github.com/ElementsProject/elements / SetPragma

Function SetPragma

src/wallet/sqlite.cpp:61–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61static 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
70SQLiteDatabase::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))

Callers 1

OpenMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected