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

Comments

Projects
None yet
2 participants
@bondcs
Copy link

commented May 11, 2018

Hi

Is possible?

Thanks you

@ClickSimply

This comment has been minimized.

Copy link
Owner

commented May 11, 2018

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

I'll put this in the next update.

@ClickSimply

This comment has been minimized.

Copy link
Owner

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

This comment has been minimized.

Copy link
Author

commented May 14, 2018

Worked perfectly.

Thank you for the rapid development.

@ClickSimply

This comment has been minimized.

Copy link
Owner

commented May 14, 2018

Sweet 😄 Marking this one resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.