| 45 | } |
| 46 | |
| 47 | static std::unique_ptr<TableFuncBindData> bindFunc(const main::ClientContext* context, |
| 48 | const TableFuncBindInput* input) { |
| 49 | std::vector<std::string> columnNames; |
| 50 | std::vector<LogicalType> columnTypes; |
| 51 | columnNames.emplace_back("name"); |
| 52 | columnTypes.emplace_back(LogicalType::STRING()); |
| 53 | columnNames.emplace_back("type"); |
| 54 | columnTypes.emplace_back(LogicalType::STRING()); |
| 55 | |
| 56 | std::vector<GraphInfo> graphInfos; |
| 57 | auto transaction = transaction::Transaction::Get(*context); |
| 58 | auto catalog = context->getDatabase()->getCatalog(); |
| 59 | |
| 60 | // Get all graphs from the main database catalog |
| 61 | auto graphEntries = catalog->getGraphEntries(transaction); |
| 62 | for (auto* entry : graphEntries) { |
| 63 | std::string graphType = entry->isAnyGraphType() ? "ANY" : "STANDARD"; |
| 64 | graphInfos.emplace_back(entry->getName(), graphType); |
| 65 | } |
| 66 | |
| 67 | columnNames = TableFunction::extractYieldVariables(columnNames, input->yieldVariables); |
| 68 | auto columns = input->binder->createVariables(columnNames, columnTypes); |
| 69 | return std::make_unique<ShowGraphsBindData>(std::move(graphInfos), std::move(columns), |
| 70 | graphInfos.size()); |
| 71 | } |
| 72 | |
| 73 | function_set ShowGraphsFunction::getFunctionSet() { |
| 74 | function_set functionSet; |
nothing calls this directly
no test coverage detected