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

Function TestRemoveReturning_RemovesClause

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

Source from the content-addressed store, hash-verified

89}
90
91func TestRemoveReturning_RemovesClause(t *testing.T) {
92 stmt := mustParse(t, "DELETE FROM users WHERE id = 1")
93
94 _ = Apply(stmt, AddReturning("id"))
95 err := Apply(stmt, RemoveReturning())
96 if err != nil {
97 t.Fatalf("RemoveReturning: %v", err)
98 }
99
100 out := format(stmt)
101 assertNotContains(t, out, "RETURNING")
102}
103
104func TestRemoveReturning_OnUpdate(t *testing.T) {
105 stmt := mustParse(t, "UPDATE users SET status = 'active'")

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