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

Method canExecuteWriteQuery

src/main/client_context.cpp:664–677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

662}
663
664bool ClientContext::canExecuteWriteQuery() const {
665 if (getDBConfig()->readOnly) {
666 return false;
667 }
668 // Note: we can only attach a remote lbug database in read-only mode and only one
669 // remote lbug database can be attached.
670 const auto dbManager = DatabaseManager::Get(*this);
671 for (const auto& attachedDB : dbManager->getAttachedDatabases()) {
672 if (attachedDB->getDBType() == ATTACHED_LBUG_DB_TYPE) {
673 return false;
674 }
675 }
676 return true;
677}
678
679} // namespace main
680} // namespace lbug

Callers 1

setContextMethod · 0.80

Calls 1

getAttachedDatabasesMethod · 0.80

Tested by

no test coverage detected