(t *testing.T)
| 19 | ) |
| 20 | |
| 21 | func TestAddReturning_OnInsert(t *testing.T) { |
| 22 | stmt := mustParse(t, "INSERT INTO users (name) VALUES ('alice')") |
| 23 | |
| 24 | err := Apply(stmt, AddReturning("id")) |
| 25 | if err != nil { |
| 26 | t.Fatalf("AddReturning on INSERT: %v", err) |
| 27 | } |
| 28 | |
| 29 | out := format(stmt) |
| 30 | assertContains(t, out, "RETURNING") |
| 31 | assertContains(t, out, "id") |
| 32 | } |
| 33 | |
| 34 | func TestAddReturning_OnUpdate(t *testing.T) { |
| 35 | stmt := mustParse(t, "UPDATE users SET status = 'active' WHERE id = 1") |
nothing calls this directly
no test coverage detected