| 36 | DatabaseManager::DatabaseManager() : defaultDatabase{""} {} |
| 37 | |
| 38 | void 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 | |
| 50 | bool DatabaseManager::hasAttachedDatabase(const std::string& name) { |
| 51 | auto upperCaseName = StringUtils::getUpper(name); |
no test coverage detected