On Sun, Dec 26, 2021, at 22:38, Joel Jacobson wrote:
> FROM permission p
> LEFT JOIN ON KEY p.role r
> LEFT JOIN team_role tr ON KEY role TO r
> LEFT JOIN ON KEY tr.team t
> LEFT JOIN user_role ur ON KEY role TO r
> LEFT JOIN ON KEY ur.user u
Hm, might be problematic to reuse dot operator, I think it would be controversial.
Perhaps this would be more SQL idiomatic:
FROM permission p
LEFT JOIN ON KEY role IN p AS r
LEFT JOIN team_role AS tr ON KEY role TO r
LEFT JOIN ON KEY team IN tr AS t
LEFT JOIN user_role AS ur ON KEY role TO r
LEFT JOIN ON KEY user IN ur AS u
/Joel