Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: add GetAuthorWithFirstBook in batch example
  • Loading branch information
Dragon-Huang0403 authored and kyleconroy committed Nov 25, 2024
commit 46ffd0243bfa26c0e1a55091c9baf08b8aa168a4
6 changes: 6 additions & 0 deletions examples/batch/postgresql/query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ WHERE book_id = $3;
-- name: GetBiography :batchone
SELECT biography FROM authors
WHERE author_id = $1;

-- name: GetAuthorWithFirstBook :batchone
SELECT sqlc.embed (books), sqlc.embed (authors)
FROM authors
INNER JOIN books ON authors.author_id = books.author_id
WHERE authors.author_id = $1;