Ff00ff/mammoth

CASE statements don't include the `CASE` and `END` keywords

Opened this issue · 0 comments

Mammoth seems to omit the CASE and END keywords:

"text": "SELECT foo.id, (WHEN foo.value > $1 THEN $2 ELSE $3) greatness FROM foo",

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.