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

Ensure job execution Advisory Lock query uses bind parameters #1287

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

bensheldon
Copy link
Owner

@bensheldon bensheldon commented Mar 18, 2024

  • Do not call to_sql when generating materialized CTE; use Arel UnaryOperation instead
  • Use a Arel::Nodes::BindParam instead of a Time value directly

@bensheldon bensheldon changed the title Do not call when generating materialized CTE; use Arel InfixOperation instead Do not call to_sql when generating materialized CTE; use Arel InfixOperation instead Mar 18, 2024
@bensheldon bensheldon force-pushed the bind_params branch 2 times, most recently from d334fc6 to 3184012 Compare March 18, 2024 12:28
@bensheldon bensheldon changed the title Do not call to_sql when generating materialized CTE; use Arel InfixOperation instead Do not call to_sql when generating materialized CTE; use Arel UnaryOperation instead Mar 18, 2024
@bensheldon bensheldon changed the title Do not call to_sql when generating materialized CTE; use Arel UnaryOperation instead Ensure job execution Advisory Lock query uses bind parameters Mar 18, 2024
@bensheldon bensheldon added the refactor Code changes that do not introduce new features label Mar 18, 2024
@bensheldon bensheldon merged commit 54f8701 into main Mar 18, 2024
20 checks passed
@bensheldon bensheldon deleted the bind_params branch March 18, 2024 13:39
messages << message
end
model_class.where(priority: 99).order(priority: :desc).advisory_lock.to_a
expect(messages.first).to match(/WHERE "good_jobs"."priority" = (\$1|\?)/)
Copy link
Owner Author

@bensheldon bensheldon Mar 21, 2024

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code changes that do not introduce new features
Projects
Development

Successfully merging this pull request may close these issues.

1 participant