Fixing a query bug for fetching all books
Get is useful for fetching a single result and scanning it, and Select is useful for fetching a slice of results.
Since our GetBooks() is for fetching all rows so instead of q.Get(&books, query) we need to change this query to q.Select(&books, query)
Fixing a query bug for fetching all books Get is useful for fetching a single result and scanning it, and Select is useful for fetching a slice of results. Since our
GetBooks()
is for fetching all rows so instead ofq.Get(&books, query)
we need to change this query toq.Select(&books, query)