When attempting to get the new coffee the following error is raised by the api because the db fields are NULL.
docker_compose-api-1 | 2023-01-06T15:21:53.779Z [ERROR] Unable to get products from database: error="sql: Scan error on column index 3, name "collection": converting NULL to string is unsupported"
go run hashicups/debug/debug.go
{"id":27,"name":"","teaser":"","collection":"","origin":"","color":"","description":"","price":0,"image":"","ingredients":null}
status: 500, body: Unable to list products
After following the tutorial I decided to implement my own resource to create a coffee.
I installed the latest client which includes support for
client.CreateCoffee
.When creating a new coffee the api does not accept
collection
,origin
orcolor
. https://github.com/hashicorp-demoapp/product-api-go/blob/f7ef7a6288dd2bba69054b4ece7e751f359a3a30/data/connection.go#L430-L431When attempting to get the new coffee the following error is raised by the api because the db fields are NULL.
https://github.com/hashicorp-demoapp/product-api-go/blob/f7ef7a6288dd2bba69054b4ece7e751f359a3a30/data/connection.go#L59
Example