Method
CreateBook
(ctx context.Context, arg CreateBookParams)
Source from the content-addressed store, hash-verified
| 140 | } |
| 141 | |
| 142 | func (q *Queries) CreateBook(ctx context.Context, arg CreateBookParams) (Book, error) { |
| 143 | row := q.db.QueryRow(ctx, createBook, |
| 144 | arg.AuthorID, |
| 145 | arg.Isbn, |
| 146 | arg.BookType, |
| 147 | arg.Title, |
| 148 | arg.Year, |
| 149 | arg.Available, |
| 150 | arg.Tags, |
| 151 | ) |
| 152 | var i Book |
| 153 | err := row.Scan( |
| 154 | &i.BookID, |
| 155 | &i.AuthorID, |
| 156 | &i.Isbn, |
| 157 | &i.BookType, |
| 158 | &i.Title, |
| 159 | &i.Year, |
| 160 | &i.Available, |
| 161 | &i.Tags, |
| 162 | ) |
| 163 | return i, err |
| 164 | } |
| 165 | |
| 166 | const deleteBook = `-- name: DeleteBook :exec |
| 167 | DELETE FROM books |
Callers
nothing calls this directly
Tested by
no test coverage detected