added a second failing test to narrow down the problem. Seems that that it is not related to the entities being returned but to the join condition
This commit is contained in:
parent
b8481fcea5
commit
3aa931cd78
18
test/Test.hs
18
test/Test.hs
@ -950,7 +950,23 @@ main = do
|
|||||||
ret `shouldBe` p
|
ret `shouldBe` p
|
||||||
pPk `shouldBe` thePk
|
pPk `shouldBe` thePk
|
||||||
|
|
||||||
it "can join with a custom primary key" $
|
it "can join with a custom primary key and return one entity" $
|
||||||
|
run $ do
|
||||||
|
let fc = Frontcover number ""
|
||||||
|
article = Article "Esqueleto supports composite pks!" thePk
|
||||||
|
number = 101
|
||||||
|
Right thePk = keyFromValues [PersistInt64 $ fromIntegral number]
|
||||||
|
fcPk <- insert fc
|
||||||
|
insert_ article
|
||||||
|
[Entity _ retFc] <- select $
|
||||||
|
from $ \(a `InnerJoin` f) -> do
|
||||||
|
on (f^.FrontcoverId ==. a^.ArticleFrontcoverId)
|
||||||
|
return f
|
||||||
|
liftIO $ do
|
||||||
|
retFc `shouldBe` fc
|
||||||
|
fcPk `shouldBe` thePk
|
||||||
|
|
||||||
|
it "can join with a custom primary key and return both entities" $
|
||||||
run $ do
|
run $ do
|
||||||
let fc = Frontcover number ""
|
let fc = Frontcover number ""
|
||||||
article = Article "Esqueleto supports composite pks!" thePk
|
article = Article "Esqueleto supports composite pks!" thePk
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user