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

Function TestRemoveReturning_OnUpdate

pkg/transform/returning_test.go:104–115  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

102}
103
104func TestRemoveReturning_OnUpdate(t *testing.T) {
105 stmt := mustParse(t, "UPDATE users SET status = 'active'")
106
107 _ = Apply(stmt, AddReturning("id", "status"))
108 err := Apply(stmt, RemoveReturning())
109 if err != nil {
110 t.Fatalf("RemoveReturning on UPDATE: %v", err)
111 }
112
113 out := format(stmt)
114 assertNotContains(t, out, "RETURNING")
115}
116
117func TestRemoveReturning_WhenAlreadyEmpty_NoError(t *testing.T) {
118 stmt := mustParse(t, "DELETE FROM users WHERE active = false")

Callers

nothing calls this directly

Calls 7

mustParseFunction · 0.85
ApplyFunction · 0.85
AddReturningFunction · 0.85
RemoveReturningFunction · 0.85
assertNotContainsFunction · 0.85
formatFunction · 0.70
FatalfMethod · 0.65

Tested by

no test coverage detected