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

Method CreateBook

examples/booktest/sqlite/query.sql.go:159–181  ·  view source on GitHub ↗
(ctx context.Context, arg CreateBookParams)

Source from the content-addressed store, hash-verified

157}
158
159func (q *Queries) CreateBook(ctx context.Context, arg CreateBookParams) (Book, error) {
160 row := q.db.QueryRowContext(ctx, createBook,
161 arg.AuthorID,
162 arg.Isbn,
163 arg.BookType,
164 arg.Title,
165 arg.Yr,
166 arg.Available,
167 arg.Tag,
168 )
169 var i Book
170 err := row.Scan(
171 &i.BookID,
172 &i.AuthorID,
173 &i.Isbn,
174 &i.BookType,
175 &i.Title,
176 &i.Yr,
177 &i.Available,
178 &i.Tag,
179 )
180 return i, err
181}
182
183const deleteAuthorBeforeYear = `-- name: DeleteAuthorBeforeYear :exec
184DELETE FROM books

Callers

nothing calls this directly

Calls 2

QueryRowContextMethod · 0.65
ScanMethod · 0.45

Tested by

no test coverage detected