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

Function Example_dialectComparison

pkg/sql/keywords/example_test.go:167–193  ·  view source on GitHub ↗

Example_dialectComparison demonstrates differences between SQL dialects.

()

Source from the content-addressed store, hash-verified

165
166// Example_dialectComparison demonstrates differences between SQL dialects.
167func Example_dialectComparison() {
168 // Generic SQL
169 generic := keywords.New(keywords.DialectGeneric, true)
170
171 // PostgreSQL
172 postgres := keywords.New(keywords.DialectPostgreSQL, true)
173
174 // MySQL
175 mysql := keywords.New(keywords.DialectMySQL, true)
176
177 // Check dialect-specific keywords
178 testWords := []string{"ILIKE", "ZEROFILL", "MATERIALIZED"}
179
180 for _, word := range testWords {
181 genericMatch := generic.IsKeyword(word)
182 postgresMatch := postgres.IsKeyword(word)
183 mysqlMatch := mysql.IsKeyword(word)
184
185 fmt.Printf("%s: Generic=%v, PostgreSQL=%v, MySQL=%v\n",
186 word, genericMatch, postgresMatch, mysqlMatch)
187 }
188
189 // Output:
190 // ILIKE: Generic=false, PostgreSQL=true, MySQL=false
191 // ZEROFILL: Generic=false, PostgreSQL=false, MySQL=true
192 // MATERIALIZED: Generic=false, PostgreSQL=true, MySQL=false
193}

Callers

nothing calls this directly

Calls 2

NewFunction · 0.92
IsKeywordMethod · 0.45

Tested by

no test coverage detected