MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / registerAttachedDatabase

Method registerAttachedDatabase

src/main/database_manager.cpp:38–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36DatabaseManager::DatabaseManager() : defaultDatabase{""} {}
37
38void DatabaseManager::registerAttachedDatabase(std::unique_ptr<AttachedDatabase> attachedDatabase) {
39 if (defaultDatabase == "") {
40 defaultDatabase = attachedDatabase->getDBName();
41 }
42 if (hasAttachedDatabase(attachedDatabase->getDBName())) {
43 throw RuntimeException{std::format(
44 "Duplicate attached database name: {}. Attached database name must be unique.",
45 attachedDatabase->getDBName())};
46 }
47 attachedDatabases.push_back(std::move(attachedDatabase));
48}
49
50bool DatabaseManager::hasAttachedDatabase(const std::string& name) {
51 auto upperCaseName = StringUtils::getUpper(name);

Callers 1

executeInternalMethod · 0.80

Calls 2

getDBNameMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected