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

Function IsValidDialect

pkg/sql/keywords/dialect.go:122–132  ·  view source on GitHub ↗

IsValidDialect reports whether name is a recognised SQL dialect identifier. An empty string is also considered valid (meaning "use the default dialect"). Example: keywords.IsValidDialect("mysql") // true keywords.IsValidDialect("fakesql") // false keywords.IsValidDialect("") /

(name string)

Source from the content-addressed store, hash-verified

120// keywords.IsValidDialect("fakesql") // false
121// keywords.IsValidDialect("") // true (default)
122func IsValidDialect(name string) bool {
123 if name == "" {
124 return true
125 }
126 for _, d := range AllDialects() {
127 if string(d) == name {
128 return true
129 }
130 }
131 return false
132}
133
134// AllDialects returns all supported SQL dialect identifiers.
135// This includes both fully implemented dialects (with dialect-specific keywords)

Callers 7

TestIsValidDialectFunction · 0.92
ValidateBytesWithDialectFunction · 0.92
ParseBytesWithDialectFunction · 0.92
validateRunFunction · 0.92

Calls 1

AllDialectsFunction · 0.85

Tested by 4

TestIsValidDialectFunction · 0.74