MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / existDBUnsafe

Method existDBUnsafe

Source/Basic/Database.cpp:64–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64bool DB::existDBUnsafe(SQLite::Database* db, String name) {
65 bool existed = false;
66 if (!name.empty()) {
67 try {
68 SQLite::Statement statement(*db, fmt::format("SELECT EXISTS(SELECT 1 FROM pragma_database_list WHERE name = ?)", name.toString()));
69 statement.bind(1, name.toString());
70 int result = 0;
71 if (statement.executeStep()) {
72 result = statement.getColumn(0);
73 }
74 existed = result == 0 ? false : true;
75 } catch (std::exception& e) {
76 Warn("failed to execute DB query: {}", e.what());
77 }
78 }
79 return existed;
80}
81
82bool DB::existDB(String name) const {
83 bool existed = false;

Callers

nothing calls this directly

Calls 8

getColumnMethod · 0.80
toStringMethod · 0.65
bindMethod · 0.65
formatFunction · 0.50
WarnFunction · 0.50
emptyMethod · 0.45
executeStepMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected