| 993 | } |
| 994 | |
| 995 | void NodeTable::buildIndexAndAdd(main::ClientContext* context, std::unique_ptr<Index> index, |
| 996 | std::optional<uint64_t> queryID) { |
| 997 | if (getIndex(index->getName()).has_value()) { |
| 998 | throw RuntimeException("Index with name " + index->getName() + " already exists."); |
| 999 | } |
| 1000 | CommittedIndexInserter indexInserter{this, index.get(), |
| 1001 | getVisibleFunc(transaction::Transaction::Get(*context))}; |
| 1002 | scanIndexColumns(context, indexInserter, *nodeGroups, queryID); |
| 1003 | indexes.push_back(IndexHolder{std::move(index)}); |
| 1004 | setHasChanges(); |
| 1005 | } |
| 1006 | |
| 1007 | void NodeTable::dropIndex(const std::string& name) { |
| 1008 | DASSERT(getIndex(name) != nullptr); |
no test coverage detected