MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / MakeSQLiteDatabase

Function MakeSQLiteDatabase

src/wallet/sqlite.cpp:701–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

699}
700
701std::unique_ptr<SQLiteDatabase> MakeSQLiteDatabase(const fs::path& path, const DatabaseOptions& options, DatabaseStatus& status, bilingual_str& error)
702{
703 try {
704 fs::path data_file = SQLiteDataFile(path);
705 auto db = std::make_unique<SQLiteDatabase>(data_file.parent_path(), data_file, options);
706 if (options.verify && !db->Verify(error)) {
707 status = DatabaseStatus::FAILED_VERIFY;
708 return nullptr;
709 }
710 status = DatabaseStatus::SUCCESS;
711 return db;
712 } catch (const std::runtime_error& e) {
713 status = DatabaseStatus::FAILED_LOAD;
714 error = Untranslated(e.what());
715 return nullptr;
716 }
717}
718
719std::string SQLiteDatabaseVersion()
720{

Callers 3

MakeDatabaseFunction · 0.85
TestDatabasesFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 4

SQLiteDataFileFunction · 0.85
UntranslatedFunction · 0.85
VerifyMethod · 0.45
whatMethod · 0.45

Tested by 2

TestDatabasesFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68