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

Function TestAddWhere_ExistingCondition

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

Source from the content-addressed store, hash-verified

63}
64
65func TestAddWhere_ExistingCondition(t *testing.T) {
66 stmt := mustParse(t, "SELECT * FROM users WHERE age > 18")
67 err := Apply(stmt, AddWhereFromSQL("status = 'active'"))
68 if err != nil {
69 t.Fatal(err)
70 }
71 out := format(stmt)
72 assertContains(t, out, "AND")
73 assertContains(t, out, "status")
74 assertContains(t, out, "age")
75}
76
77func TestAddWhere_UpdateStatement(t *testing.T) {
78 stmt := mustParse(t, "UPDATE users SET name = 'bob'")

Callers

nothing calls this directly

Calls 5

mustParseFunction · 0.85
ApplyFunction · 0.85
AddWhereFromSQLFunction · 0.85
assertContainsFunction · 0.85
formatFunction · 0.70

Tested by

no test coverage detected