Closed felipexpert closed 3 years ago
Hi, This might be the problem ...
see https://hackage.haskell.org/package/esqueleto-2.4.3/docs/Database-Esqueleto.html
select $
from $ (p1 InnerJoin
f InnerJoin
p2) -> do
on (p2 ^. PersonId ==. f ^. FollowFollowed)
on (p1 ^. PersonId ==. f ^. FollowFollower)
return (p1, f, p2)
Note carefully that the order of the ON clauses is reversed! You're required to write your ons in reverse order because that helps composability (see the documentation of on for more details).
Best, Grant
Thank you for this helpful information
please, post this as an answer on my question
http://stackoverflow.com/questions/35961786/yesod-persistent-odbc-issue
My relevant models:
Now my
Esqueleto
expression:The code I showed generated the following select instruction (which is wrong):
It is flipping the on clause in the JOIN!! Please, help me, I have to deliver this code next week...
The correct select instruction should be: