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

Method getNumNodes

src/main/storage_driver.cpp:113–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113uint64_t StorageDriver::getNumNodes(const std::string& nodeName) const {
114 clientContext->query("BEGIN TRANSACTION READ ONLY;");
115 auto transaction = Transaction::Get(*clientContext);
116 auto catalogEntry = getEntry(*clientContext, nodeName);
117
118 if (catalogEntry->getType() != CatalogEntryType::NODE_TABLE_ENTRY) {
119 clientContext->query("COMMIT");
120 throw RuntimeException(std::format("{} is not a node table", nodeName));
121 }
122
123 uint64_t result = StorageManager::Get(*clientContext)
124 ->getTable(catalogEntry->getTableID())
125 ->getNumTotalRows(transaction);
126 clientContext->query("COMMIT");
127 return result;
128}
129
130uint64_t StorageDriver::getNumRels(const std::string& relName) const {
131 clientContext->query("BEGIN TRANSACTION READ ONLY;");

Callers 1

TEST_FFunction · 0.45

Calls 5

getEntryFunction · 0.70
queryMethod · 0.45
getTypeMethod · 0.45
getNumTotalRowsMethod · 0.45
getTableMethod · 0.45

Tested by 1

TEST_FFunction · 0.36