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

Function TestAddReturning_OnUpdate

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

Source from the content-addressed store, hash-verified

32}
33
34func TestAddReturning_OnUpdate(t *testing.T) {
35 stmt := mustParse(t, "UPDATE users SET status = 'active' WHERE id = 1")
36
37 err := Apply(stmt, AddReturning("id", "updated_at"))
38 if err != nil {
39 t.Fatalf("AddReturning on UPDATE: %v", err)
40 }
41
42 out := format(stmt)
43 assertContains(t, out, "RETURNING")
44 assertContains(t, out, "id")
45 assertContains(t, out, "updated_at")
46}
47
48func TestAddReturning_OnDelete(t *testing.T) {
49 stmt := mustParse(t, "DELETE FROM users WHERE id = 1")

Callers

nothing calls this directly

Calls 6

mustParseFunction · 0.85
ApplyFunction · 0.85
AddReturningFunction · 0.85
assertContainsFunction · 0.85
formatFunction · 0.70
FatalfMethod · 0.65

Tested by

no test coverage detected