Skip to content

Multiple joins in a from clause #3

@bnhardy

Description

@bnhardy

Looking to add multiple join statements at varying points in a code block.

let mut query = xql::select(["*"]);
query = query.from(xql::join(...));
if true {
    query = query.from(xql::join(...));
}

The problem is that the two joins are now comma separated. What is the proper way of building the following statement by adding the second join later on in the code block?:

"SELECT * FROM person JOIN employee ON person.person_id = employee.person_id JOIN employee_team ON employee.employee_id = employee_team.employee_id"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions