Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple joins in the same query #41

Closed
bondcs opened this issue May 11, 2018 · 4 comments
Closed

Multiple joins in the same query #41

bondcs opened this issue May 11, 2018 · 4 comments

Comments

@bondcs
Copy link

bondcs commented May 11, 2018

Hi

Is possible?

Thanks you

@only-cliches
Copy link
Owner

Not yet, but this should be pretty easy to add.

I'll put this in the next update.

@only-cliches
Copy link
Owner

only-cliches commented May 13, 2018

Just pushed v1.5.5 with multiple join support.

Just pass an array of join arguments into .join(), like this:

nSQL("users").query("select").join([
    {
        type: "inner",
        table: "posts",
        where: ["users.id", "=", "posts.author"]
    },
    {
        type: "inner",
        table: "comments",
        where: ["users.id", "=", "comments.author"]
    }
]).exec()...

Let me know if that works as expected!

@bondcs
Copy link
Author

bondcs commented May 14, 2018

Worked perfectly.

Thank you for the rapid development.

@only-cliches
Copy link
Owner

Sweet 😄 Marking this one resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants