Closed
Description
I've got a query that looks something like this (though there are multiple columns being set):
-- name: UpdateFoo :one
UPDATE foo
SET
bar = CASE WHEN $1::bool
THEN $2::bar_type
ELSE bar
END
RETURNING *;
This produces a params struct like this:
type UpdateFooParams struct {
Column1 bool `json:""`
Column2_2 bar_type `json:"_2"`
}
The naming here isn't very helpful. Do you have any suggestions on how this can be improved? Either by using a different kind of query (that allows updating multiple fields, each one optional) or by somehow annotating things such that the params struct uses more helpful naming?