MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / GetBook

Method GetBook

examples/booktest/postgresql/query.sql.go:193–207  ·  view source on GitHub ↗
(ctx context.Context, bookID int32)

Source from the content-addressed store, hash-verified

191`
192
193func (q *Queries) GetBook(ctx context.Context, bookID int32) (Book, error) {
194 row := q.db.QueryRow(ctx, getBook, bookID)
195 var i Book
196 err := row.Scan(
197 &i.BookID,
198 &i.AuthorID,
199 &i.Isbn,
200 &i.BookType,
201 &i.Title,
202 &i.Year,
203 &i.Available,
204 &i.Tags,
205 )
206 return i, err
207}
208
209const sayHello = `-- name: SayHello :one
210select say_hello from say_hello($1)

Callers 1

TestBooksFunction · 0.45

Calls 2

QueryRowMethod · 0.65
ScanMethod · 0.45

Tested by 1

TestBooksFunction · 0.36