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

Function DialectKeywords

pkg/sql/keywords/dialect.go:88–112  ·  view source on GitHub ↗

DialectKeywords returns the additional keywords for a specific dialect. This is a convenience function for retrieving dialect-specific keyword lists without constructing a full Keywords instance. Returns nil for DialectGeneric and unrecognized dialects. Example: snowflakeKws := keywords.DialectK

(dialect SQLDialect)

Source from the content-addressed store, hash-verified

86// fmt.Println(kw.Word)
87// }
88func DialectKeywords(dialect SQLDialect) []Keyword {
89 switch dialect {
90 case DialectSnowflake:
91 return SNOWFLAKE_SPECIFIC
92 case DialectMySQL:
93 return MYSQL_SPECIFIC
94 case DialectMariaDB:
95 combined := make([]Keyword, 0, len(MYSQL_SPECIFIC)+len(MARIADB_SPECIFIC))
96 combined = append(combined, MYSQL_SPECIFIC...)
97 combined = append(combined, MARIADB_SPECIFIC...)
98 return combined
99 case DialectPostgreSQL:
100 return POSTGRESQL_SPECIFIC
101 case DialectSQLite:
102 return SQLITE_SPECIFIC
103 case DialectSQLServer:
104 return SQLSERVER_SPECIFIC
105 case DialectOracle:
106 return ORACLE_SPECIFIC
107 case DialectClickHouse:
108 return CLICKHOUSE_SPECIFIC
109 default:
110 return nil
111 }
112}
113
114// IsValidDialect reports whether name is a recognised SQL dialect identifier.
115// An empty string is also considered valid (meaning "use the default dialect").

Callers 4

TestDialectRegistryFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestDialectRegistryFunction · 0.68