I am trying to join two tables using Slicks 3.0 monadic joins like this:
def getInfo(id: Int) = {
val innerJoin = for {
a <- tableA
b <- tableB if a.id === b.s_id
} yield b.name
println(innerJoin) // results in Rep(Bind)
innerJoin.map(println(_)) // results in Rep(Ref @1535257794)
}
Now I want to get the values from the join results. I tried a lot to get the values but it seems to be harder then I imagined. I always get some sort of Rep(Bind) back when I try to print the values (see comments above).
There is also this post which addresses the same problem. I tried the suggested solution which looks like this:
innerJoin.map(c => c).forEach(id =>
println(id)
)
Which doesn't even compile since forEach is not defined in that place. I don't really know how to proceed here an what to try next. Can someone help me out?
Thanks...