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

Function TestAddWhere_NewCondition

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

Source from the content-addressed store, hash-verified

52}
53
54func TestAddWhere_NewCondition(t *testing.T) {
55 stmt := mustParse(t, "SELECT id, name FROM users")
56 err := Apply(stmt, AddWhereFromSQL("active = true"))
57 if err != nil {
58 t.Fatal(err)
59 }
60 out := format(stmt)
61 assertContains(t, out, "WHERE")
62 assertContains(t, out, "active")
63}
64
65func TestAddWhere_ExistingCondition(t *testing.T) {
66 stmt := mustParse(t, "SELECT * FROM users WHERE age > 18")

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