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

Method getNumRels

src/main/storage_driver.cpp:130–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130uint64_t StorageDriver::getNumRels(const std::string& relName) const {
131 clientContext->query("BEGIN TRANSACTION READ ONLY;");
132 auto transaction = Transaction::Get(*clientContext);
133 auto catalogEntry = getEntry(*clientContext, relName);
134
135 if (catalogEntry->getType() != CatalogEntryType::REL_GROUP_ENTRY) {
136 clientContext->query("COMMIT");
137 throw RuntimeException(std::format("{} is not a relationship table", relName));
138 }
139
140 uint64_t result = 0;
141 auto relGroupCatalogEntry = catalogEntry->ptrCast<RelGroupCatalogEntry>();
142
143 for (const auto& relTableInfo : relGroupCatalogEntry->getRelEntryInfos()) {
144 auto table = StorageManager::Get(*clientContext)->getTable(relTableInfo.oid);
145 result += table->getNumTotalRows(transaction);
146 }
147
148 clientContext->query("COMMIT");
149 return result;
150}
151
152void StorageDriver::scanColumn(Table* table, column_id_t columnID, const offset_t* offsets,
153 size_t size, uint8_t* result) const {

Callers 1

TEST_FFunction · 0.45

Calls 5

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

Tested by 1

TEST_FFunction · 0.36