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

Method executeInternal

src/processor/operator/simple/detach_database.cpp:16–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16void DetachDatabase::executeInternal(ExecutionContext* context) {
17 auto clientContext = context->clientContext;
18 auto dbManager = main::DatabaseManager::Get(*clientContext);
19 if (dbManager->hasAttachedDatabase(dbName) &&
20 dbManager->getAttachedDatabase(dbName)->getDBType() == common::ATTACHED_LBUG_DB_TYPE) {
21 clientContext->setDefaultDatabase(nullptr /* defaultDatabase */);
22 }
23 dbManager->detachDatabase(dbName);
24 appendMessage("Detached database successfully.", storage::MemoryManager::Get(*clientContext));
25}
26
27} // namespace processor
28} // namespace lbug

Callers

nothing calls this directly

Calls 4

hasAttachedDatabaseMethod · 0.80
detachDatabaseMethod · 0.80
getAttachedDatabaseMethod · 0.45
setDefaultDatabaseMethod · 0.45

Tested by

no test coverage detected