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

Function TestValidateWithDialect

pkg/sql/parser/dialect_test.go:86–96  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestValidateWithDialect(t *testing.T) {
87 err := ValidateWithDialect("SELECT * FROM users WHERE id = 1", keywords.DialectMySQL)
88 if err != nil {
89 t.Fatalf("ValidateWithDialect(mysql) failed: %v", err)
90 }
91
92 err = ValidateWithDialect("SELECT * FROM users WHERE id = 1", keywords.DialectPostgreSQL)
93 if err != nil {
94 t.Fatalf("ValidateWithDialect(postgresql) failed: %v", err)
95 }
96}
97
98func TestDefaultBehaviorUnchanged(t *testing.T) {
99 // Validate() without dialect should still work (backward compatibility)

Callers

nothing calls this directly

Calls 2

ValidateWithDialectFunction · 0.85
FatalfMethod · 0.65

Tested by

no test coverage detected