validDialectList returns a human-readable comma-separated list of all valid dialect names for use in error messages.
()
| 80 | // validDialectList returns a human-readable comma-separated list of all valid |
| 81 | // dialect names for use in error messages. |
| 82 | func validDialectList() string { |
| 83 | dialects := keywords.AllDialects() |
| 84 | names := make([]string, 0, len(dialects)) |
| 85 | for _, d := range dialects { |
| 86 | // Belt-and-suspenders: DialectUnknown is not in AllDialects(), but guard |
| 87 | // here in case a future refactor inadvertently adds it back. |
| 88 | if d != keywords.DialectUnknown { |
| 89 | names = append(names, string(d)) |
| 90 | } |
| 91 | } |
| 92 | return strings.Join(names, ", ") |
| 93 | } |
| 94 | |
| 95 | // ParseBytes parses SQL from a []byte input without requiring a string conversion. |
| 96 | // This is especially useful when reading SQL from files via os.ReadFile. |
no test coverage detected