| 58 | } |
| 59 | |
| 60 | std::string ScalarMacroFunction::toCypher(const std::string& name) const { |
| 61 | std::vector<std::string> paramStrings; |
| 62 | for (auto& param : positionalArgs) { |
| 63 | paramStrings.push_back(param); |
| 64 | } |
| 65 | for (auto& defaultParam : defaultArgs) { |
| 66 | paramStrings.push_back(defaultParam.first + ":=" + defaultParam.second->toString()); |
| 67 | } |
| 68 | return std::format("CREATE MACRO `{}` ({}) AS {};", name, StringUtils::join(paramStrings, ","), |
| 69 | expression->toString()); |
| 70 | } |
| 71 | } // namespace function |
| 72 | } // namespace lbug |