tomjaguarpaw / haskell-opaleye

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question/typo for insert example in tutorial

chris-martin opened this issue · comments

Why does id get set to DEFAULT in this query?

Good catch. It doesn't!

*TutorialManipulation Opaleye.Internal.Manipulation> putStrLn $ case update of Update {..} -> arrangeUpdateSql uTable uUpdateWith uWhere
UPDATE "tablename"
SET "id" = "id",
    "x" = ("x") + ("y"),
    "y" = ("x") - ("y"),
    "s" = "s"
WHERE (("id") = (CAST(5 AS integer)))

Thanks for the report. I'll get this fixed at some point, unless you want to submit a PR. Just requires changing SET "id" = DEFAULT, to SET "id" = "id",.

Thanks, that's what I hoped 😄 PR submitted.