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

Delete by multiple primary keys #49

Open
Eldow opened this issue May 17, 2021 · 0 comments
Open

Delete by multiple primary keys #49

Eldow opened this issue May 17, 2021 · 0 comments

Comments

@Eldow
Copy link
Contributor

Eldow commented May 17, 2021

I found an issue while performing delete mutations from multiple primary keys :

       deleteByCarIdAndBrandId: [
          {
            carId: 514,
            brandId: 43
          }
        ]

Pg compiler outputs an error : Unpexcted character ')'

After some reseach, I looked at the computed query and it looks like this :

delete from "public"."Cars"\n' +
                where \n' +
                    "car_id" = $1\n' +
                  ) and (\n' +
                    "brand_id" = $2\n' +

Fixed it by wrapping the where clause inside parenthesis.

Let me know if I should make a PR for this !

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

No branches or pull requests

1 participant