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

manage raw where clause with array as param #1044

Conversation

davidepaolotua
Copy link
Contributor

Implements #1031

Btw, is there any reason for which the raw does param substitution and does not use bind variables? Albeit small, there might be a perf hit, in that case

Copy link
Member

@jwoertink jwoertink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh awesome! You know, I'm not sure why the ? was used instead of bind variables... My only guess is because that's what Rails did? 🤷‍♂️ I know it has made a few of the jsonb operations a bit difficult.

I guess thinking about it.... If you did UserQuery.new.admin(true).where("something = ?", whatever) you'd have to know that the admin(true) is already using $1, so your ? would need to be $2 in this case. That could get real messy trying to track that in larger queries where you might use methods for a larger portion like

UserQuery.new.for_some_special_case.where("something = $5", whatever)

😂 I don't know if that's the real reason or not, but that's my best guess.

@jwoertink jwoertink merged commit 3a27ebb into luckyframework:main Jun 16, 2024
8 of 9 checks passed
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

Successfully merging this pull request may close these issues.

2 participants