| 46 | } |
| 47 | |
| 48 | static std::unique_ptr<TableFuncBindData> bindFunc(const main::ClientContext* context, |
| 49 | const TableFuncBindInput* input) { |
| 50 | std::vector<std::string> columnNames; |
| 51 | std::vector<LogicalType> columnTypes; |
| 52 | columnNames.emplace_back("name"); |
| 53 | columnTypes.emplace_back(LogicalType::STRING()); |
| 54 | columnNames.emplace_back("definition"); |
| 55 | columnTypes.emplace_back(LogicalType::STRING()); |
| 56 | std::vector<MacroInfo> macroInfos; |
| 57 | auto transaction = transaction::Transaction::Get(*context); |
| 58 | auto catalog = Catalog::Get(*context); |
| 59 | for (auto& entry : catalog->getMacroEntries(transaction)) { |
| 60 | std::string name = entry->getName(); |
| 61 | auto macroFunction = catalog->getScalarMacroFunction(transaction, name); |
| 62 | macroInfos.emplace_back(name, macroFunction->toCypher(name)); |
| 63 | } |
| 64 | columnNames = TableFunction::extractYieldVariables(columnNames, input->yieldVariables); |
| 65 | auto columns = input->binder->createVariables(columnNames, columnTypes); |
| 66 | return std::make_unique<ShowMacrosBindData>(std::move(macroInfos), std::move(columns), |
| 67 | macroInfos.size()); |
| 68 | } |
| 69 | |
| 70 | function_set ShowMacrosFunction::getFunctionSet() { |
| 71 | function_set functionSet; |
nothing calls this directly
no test coverage detected