Skip to content

Support IN operator. #240

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

Closed
chakrit opened this issue Feb 28, 2014 · 3 comments
Closed

Support IN operator. #240

chakrit opened this issue Feb 28, 2014 · 3 comments

Comments

@chakrit
Copy link

chakrit commented Feb 28, 2014

Not sure this is part of #49 but i think this is a separate issue since it is input-only and does not require full output binding and also a much more common use cases than arrays IMO.

Query: SELECT * FROM members WHERE member_id IN $1

Right now the driver panics with the type []string not being supported. (My record ids are strings)

@chakrit
Copy link
Author

chakrit commented Feb 28, 2014

Cc : @schumarn

@johto
Copy link
Contributor

johto commented Feb 28, 2014

IN wouldn't work for this, but if we supported arrays we could do WHERE member_id = ANY($1).

@johto
Copy link
Contributor

johto commented Feb 28, 2014

To add to my previous response, IN (1,2,3) would internally get converted to = ANY(ARRAY[1,2,3]), so in the end they're the same thing. Also the list after IN can't be parameterized, so we'd have to do something like #233 to support this, and I really would rather not go there.

I don't see any new feature here (other than passing in a slice as an array), so I'm closing this one. Let's keep the discussion about supporting arrays where it belongs.

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

2 participants