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

Can't pass an array literal in to raw WHERE #1031

Open
jwoertink opened this issue Apr 25, 2024 · 1 comment
Open

Can't pass an array literal in to raw WHERE #1031

jwoertink opened this issue Apr 25, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@jwoertink
Copy link
Member

This code throws a SQL syntax error

UserQuery.new.where("tags && ?", ["ruby", "crystal"])
@jwoertink jwoertink added the bug Something isn't working label Apr 25, 2024
@jwoertink
Copy link
Member Author

You can work around this by using PQ::Param.encode_array

UserQuery.new.where("tags && ?", PQ::Param.encode_array(["ruby", "crystal"]))

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