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

Function TestAddWhere_UpdateStatement

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

Source from the content-addressed store, hash-verified

75}
76
77func TestAddWhere_UpdateStatement(t *testing.T) {
78 stmt := mustParse(t, "UPDATE users SET name = 'bob'")
79 err := Apply(stmt, AddWhereFromSQL("id = 1"))
80 if err != nil {
81 t.Fatal(err)
82 }
83 out := format(stmt)
84 assertContains(t, out, "WHERE")
85 assertContains(t, out, "id")
86}
87
88func TestAddWhere_DeleteStatement(t *testing.T) {
89 stmt := mustParse(t, "DELETE FROM users")

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