Closed
Description
Queries using conditional expressions like NULLIF and COALESCE generate proper Go code. Meanwhile, the CASE conditional expression does not. The generated go code doesn't generate an additional field in the result struct, making the Scan fail each time is called. I will try to investigate this issue later on the week and try to provide a fix. The following query can be used to reproduce the observed behavior:
SELECT
id,
CASE
WHEN id = $1 THEN true
ELSE false
END is_one
FROM
author;