Skip to content

Commit 46ffd02

Browse files
Dragon-Huang0403kyleconroy
authored andcommitted
test: add GetAuthorWithFirstBook in batch example
1 parent 0b952b4 commit 46ffd02

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

examples/batch/postgresql/query.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,9 @@ WHERE book_id = $3;
5454
-- name: GetBiography :batchone
5555
SELECT biography FROM authors
5656
WHERE author_id = $1;
57+
58+
-- name: GetAuthorWithFirstBook :batchone
59+
SELECT sqlc.embed (books), sqlc.embed (authors)
60+
FROM authors
61+
INNER JOIN books ON authors.author_id = books.author_id
62+
WHERE authors.author_id = $1;

0 commit comments

Comments
 (0)