Skip to content

Incrementing a variable #234

Closed Answered by idontgetoutmuch
idontgetoutmuch asked this question in Q&A
Discussion options

You must be logged in to vote
newtype AuthorId = AuthrId { toInt64 :: Int64 }
  deriving newtype (DBEq, DBType, DBNum, Eq, Show)


preUrj :: Update ()
preUrj = Rel8.Update
  { target = authorSchema
  , from = pure ()
  , set = \_ r -> r {  authorId = 1 + authorId r, Main.name = "idontgetoutmuch" }
  , updateWhere = \_ r -> Main.name r Rel8.==. (litExpr "Emily Pilmore")
  , returning = pure ()
  }

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ocharles
Comment options

Answer selected by idontgetoutmuch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants