-
Notifications
You must be signed in to change notification settings - Fork 312
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
Add allow_retry kwarg to execute (7) #2374
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduce the _connection method which returns whichever is defined between @unconfigured_connection or @raw_connection.
verify! ensures that @raw_connection is defined.
Rails commit bd19d1baf1 [1] added a check of logger.level which was not supported by the MockLogger. This commit adds a mock level method. And limits the missing_method to respond only to logging calls, so any other calls will raise a NoMethodError to make future debugging easier. [1] rails/rails@bd19d1b
The SchemaMigration object no longer inherits from ActiveRecord::Base. See "Move SchemaMigration to an independent object" rails/rails@436277d Several methods were renamed, and are no longer available as class methods on SchemaMigration, but as an instance of SchemaMigration per connection. The object per connection seems to remove the need to `reset_table_name` in the tests. That method is not available on the new object.
andynu
changed the title
Add allow_retry kwarg to execute
Add allow_retry kwarg to execute (8/10)
Mar 25, 2024
andynu
force-pushed
the
stack-07-retry-kwarg
branch
2 times, most recently
from
March 25, 2024 20:27
bb49ea0
to
113446a
Compare
andynu
changed the title
Add allow_retry kwarg to execute (8/10)
Add allow_retry kwarg to execute (7/10)
Mar 25, 2024
andynu
force-pushed
the
stack-07-retry-kwarg
branch
from
March 25, 2024 21:37
113446a
to
49bdc42
Compare
andynu
changed the title
Add allow_retry kwarg to execute (7/10)
Add allow_retry kwarg to execute (7)
Mar 26, 2024
Rails commit e6da3ebd6c6 [1] introduces ColumnDefinition validations for the keywords used in database commands. This commit adds the additional keywords supported by this gem. [1] rails/rails@e6da3eb
See rails/rails@07d2407 Both `table_name` and `column_name` were removed in favor of doing o.left in the visitor pattern. This is just mimicing the adjustments from upstream.
This extends the existing class level auto_retry functionality to optionally allow an allow_retry boolean kwarg to allow retry of specific queries. This PR preserves the requirement that `autocommit?` be enabled which is the safer choice. ``` def with_retry(allow_retry: false) # :nodoc: should_retry = (allow_retry || self.class.auto_retry?) && autocommit? ``` See issue rsim#2310
andynu
force-pushed
the
stack-07-retry-kwarg
branch
from
April 1, 2024 16:09
49bdc42
to
b992d08
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add allow_retry kwarg to execute
This extends the existing class level auto_retry functionality to
optionally allow an allow_retry boolean kwarg to allow retry of specific
queries.
This PR preserves the requirement that
autocommit?
be enabled, which is thesafer choice.
See issue #2310
Stacked on #2372