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

Function TestAddWhere_UnsupportedStatement

pkg/transform/where_test.go:125–134  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

123}
124
125func TestAddWhere_UnsupportedStatement(t *testing.T) {
126 stmt := mustParse(t, "INSERT INTO users (name) VALUES ('bob')")
127 err := Apply(stmt, AddWhereFromSQL("id = 1"))
128 if err == nil {
129 t.Fatal("expected error for INSERT statement")
130 }
131 if !strings.Contains(err.Error(), "unsupported") {
132 t.Fatalf("unexpected error: %v", err)
133 }
134}
135
136func TestAddWhere_DirectExpression(t *testing.T) {
137 stmt := mustParse(t, "SELECT * FROM users")

Callers

nothing calls this directly

Calls 5

mustParseFunction · 0.85
ApplyFunction · 0.85
AddWhereFromSQLFunction · 0.85
FatalfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected