Skip to content

Commit 2825bd7

Browse files
committed
test returning clause
1 parent 0fcb713 commit 2825bd7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

insert_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ func TestInsert(t *testing.T) {
2121
wantQuery: "INSERT INTO products (title, description) VALUES ($1, $2), ($3, $4), ($5, $6)",
2222
args: []interface{}{"airpod", "airpod description", "airpod 2", "airpod 2 description", "airpod 3", "airpod 3 description"},
2323
},
24+
{
25+
query: Insert("products").Columns("id, title, description").
26+
Values("id1", "airpod", "airpod description").
27+
Values("id2", "airpod 2", "airpod 2 description").
28+
Values("id3", "airpod 3", "airpod 3 description").
29+
Returning("id, title"),
30+
wantQuery: "INSERT INTO products (id, title, description) VALUES ($1, $2, $3), ($4, $5, $6), ($7, $8, $9) RETURNING id, title",
31+
args: []interface{}{"id1", "airpod", "airpod description", "id2", "airpod 2", "airpod 2 description", "id3", "airpod 3", "airpod 3 description"},
32+
},
2433
}
2534

2635
for _, c := range cases {

0 commit comments

Comments
 (0)