The nice thing about the query builder is that you don’t have to create the joins if you have the relations.
Just reference them directly. You should get code complete
Also you can chain relations together, i.e: q.joins.relation_a.joins.relation_b.columns.some_column
var query = datasources.db.hades.persons.createSelect();
var groups = query.joins.persons_to_persons_access_right_groups.joins.persons_access_right_groups_to_access_right_groups;
query.result
.add(query.columns.id)
.add(groups.columns.id)
query.where
.add(query.columns.usr.eq(username))
.add(query.columns.pwd.eq(password));
Thanks for your tip. I did not notice your proposed notation for (chained) relations in the documentation. I found and used (for one relation) the following notation (as example) and tried to append another relation just by a dot (.) as is possible outside the QB. But that didn’t work. Your notation does.
var join = queryMenuAccessRights.joins.add('menu_access_rights_classifying_menus', 'm');