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

OR clause does not work with AND clause #426

Closed
HeyItsJs opened this issue Oct 4, 2019 · 0 comments
Closed

OR clause does not work with AND clause #426

HeyItsJs opened this issue Oct 4, 2019 · 0 comments
Labels
🐛 bug Something isn't working

Comments

@HeyItsJs
Copy link
Contributor

HeyItsJs commented Oct 4, 2019

Describe the bug

The following query does not work in Postgres:

const whereClause = and(
  or(
    cond("cat", "==", "Science"),
    cond("author", "==", "Noorain")
  ),
  cond("id", "==", "1")
)
dbPostgres.get("posts").where(whereClause).apply()

The actual SQL query generated by Space Cloud is:

SELECT * FROM todo_app.posts WHERE ((cat = $1) OR (author = $2))

Your environment

  • Space Cloud version: v0.12.0
  • OS: Linux

If this bug restricts your use of space-cloud, give it a thumbs up reaction, so that we can determine which bugs need to be fixed immediately.
👍

@HeyItsJs HeyItsJs added the 🐛 bug Something isn't working label Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant