4 ms·
Ah ok, I see. Slick actually does have a nice shorthand for fkey joins: val q = for{ ur <- UserRole; u <- ur.user; r <- ur.role } yield(ur,u,r)
by virtualwhys 12y ago
Ah ok, I see. Slick actually does have a nice shorthand for fkey joins:
val q = for{
ur <- UserRole; u <- ur.user; r <- ur.role
} yield(ur,u,r)
which would produce semantic equivalent to:
select ur.id, ur.a, ..., u.id, u.a ...
from userrole ur
join user u on u.id = ur.userId
join role r on r. id = ur.roleId
grouping and sorting is where Slick becomes less readable SQL-like DSL and more boilerplate DSL full of meaningless tuples O_o