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

Function TestAddReturning_OnDelete

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

Source from the content-addressed store, hash-verified

46}
47
48func TestAddReturning_OnDelete(t *testing.T) {
49 stmt := mustParse(t, "DELETE FROM users WHERE id = 1")
50
51 err := Apply(stmt, AddReturning("id"))
52 if err != nil {
53 t.Fatalf("AddReturning on DELETE: %v", err)
54 }
55
56 out := format(stmt)
57 assertContains(t, out, "RETURNING")
58 assertContains(t, out, "id")
59}
60
61func TestAddReturning_MultipleColumns(t *testing.T) {
62 stmt := mustParse(t, "INSERT INTO orders (product_id, qty) VALUES (1, 5)")

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