-
I have the following table:
And I'm trying to figure out how to insert a user. I have this snippet in a Yesod Handler
But I'm getting
I thought I might be able to do something like How do I handle this correctly? It seems like a pretty foundational use case. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I think you have a few options:
I'm not sure we have a great story here, but hopefully one of these options will work for you! |
Beta Was this translation helpful? Give feedback.
-
I was about to resort to |
Beta Was this translation helpful? Give feedback.
-
I'm assuming you meant |
Beta Was this translation helpful? Give feedback.
I think you have a few options:
nextval
with the type you want.unsafeCoerceExpr
to castInt64
intoUserId
.DBNum
instance toUserId
, and then you can useRel8.Expr.Num.fromIntegral
to castInt64
toUserId
. This might be a bit unfortunate as it means you can now+
UserId
s.I'm not sure we have a great story here, but hopefully one of these options will work for you!