Sweet but simple, how do Persistent joins work? Consider the following model:
Person
number Int
numberOfEyes Int
firstName FirstnamesId
lastName LastnamesId
Lastnames
lastname String
Firstnames
firstname String
Assuming I only have the number of a Person, how do I retrieve his full name and the number of his eyes?
I tried looking through the haskellers.org source but couldn't find any examples of joins. I also checked out the chapter on joins in the yesod book but it only made my eyes spin. The level of my Haskell knowledge is very low so be gentle.
Here are two ways with identical result type:
and the previous rawSql way
just add 1 or 2 as argument to the test
extra module for heredoc quasiquoter
execution: