(out *strings.Builder, schemaName string, function *storepb.FunctionMetadata, replace bool)
| 1716 | } |
| 1717 | |
| 1718 | func writeFunctionStatement(out *strings.Builder, schemaName string, function *storepb.FunctionMetadata, replace bool) error { |
| 1719 | definition := function.GetDefinition() |
| 1720 | if replace { |
| 1721 | definition = convertCreateFunctionToCreateOrReplace(definition) |
| 1722 | } |
| 1723 | if err := writeDefinitionStatement(out, definition); err != nil { |
| 1724 | return err |
| 1725 | } |
| 1726 | if function.GetComment() != "" { |
| 1727 | return writeFunctionComment(out, schemaName, function) |
| 1728 | } |
| 1729 | return nil |
| 1730 | } |
| 1731 | |
| 1732 | func convertCreateFunctionToCreateOrReplace(definition string) string { |
| 1733 | trimmedLeft := strings.TrimLeft(definition, " \t\r\n") |
no test coverage detected