CASE statements don't include the `CASE` and `END` keywords
Opened this issue · 0 comments
young-mmfm commented
Mammoth seems to omit the CASE
and END
keywords:
When I run the query
"SELECT foo.id, (WHEN foo.value > $1 THEN $2 ELSE $3) greatness FROM foo"
Postgres returns:
ERROR: syntax error at or near "WHEN"
When I run the query
"SELECT foo.id, (CASE WHEN foo.value > $1 THEN $2 ELSE $3 END) greatness FROM foo"
Postgres runs the query correctly.