Open MuhammedZakir opened 2 years ago
Is ProductId
treated differently? This works:
import Database.Persist as DP ( (==.) )
q $ deleteWhere [ProductName DP.==. "some name"]
This doesn't:
q $ deleteWhere [ProductId DP.==. 1]
throws
• No instance for (Num ProductId) arising from the literal ‘15’
• In the second argument of ‘(DP.>=.)’, namely ‘15’
Note: I ran these in ghci
.
Out of topic: [ProductName ==. "text"] is better than
[ps ^. ProductName ==. val "name"]`. For the query, I can understand it as maybe optimization, better generated query and better type-level safety. But for this, I don't understand. What was the reason for choosing the latter?
Late, but, thank you very much for this library!
Schema:
Helper functions:
For above schema, running this in
ghci
throws
This works: