MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / validDialectList

Function validDialectList

pkg/sql/parser/validate.go:82–93  ·  view source on GitHub ↗

validDialectList returns a human-readable comma-separated list of all valid dialect names for use in error messages.

()

Source from the content-addressed store, hash-verified

80// validDialectList returns a human-readable comma-separated list of all valid
81// dialect names for use in error messages.
82func 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.

Callers 2

ValidateBytesWithDialectFunction · 0.85
ParseBytesWithDialectFunction · 0.85

Calls 1

AllDialectsFunction · 0.92

Tested by

no test coverage detected