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

Use find_by_sql for SQL lookups #193

Merged
merged 1 commit into from
Aug 13, 2024
Merged

Use find_by_sql for SQL lookups #193

merged 1 commit into from
Aug 13, 2024

Conversation

djmb
Copy link
Collaborator

@djmb djmb commented Aug 13, 2024

Instead construct the query once with to_sql, replacing the dummy values with ?s. Then use find_by_sql to execute the query.

This is as efficient as the previous method but avoids ActiveRecord internals.

Instead construct the query once with `to_sql`, replacing the dummy
values with `?`s. Then use find_by_sql to execute the query.

This is as efficient as the previous method but avoids ActiveRecord
internals.
@djmb djmb merged commit 986f8fe into main Aug 13, 2024
37 checks passed
@djmb djmb deleted the find-by-sql branch August 13, 2024 10:45
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.

1 participant