Skip to content

Commit 21c84e1

Browse files
committed
Make internal query() retryable for postgresql
In a [previous commit][1], the abstract adapter's `query` method was changed to automatically retry (since the method is used for SCHEMA type queries, which are idempotent SELECTs). However, the postgresql adapter has its own `query` method and it was not changed. This commit makes the same change to the postgresql adapter's `query` so that it can also benefit from automatically retryable SCHEMA queries. [1]: b4c19d0
1 parent 4d42d34 commit 21c84e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def explain(arel, binds = [], options = [])
1111
end
1212

1313
# Queries the database and returns the results in an Array-like object
14-
def query(sql, name = nil) # :nodoc:
15-
result = internal_execute(sql, name)
14+
def query(sql, name = nil, allow_retry: true, materialize_transactions: true) # :nodoc:
15+
result = internal_execute(sql, name, allow_retry:, materialize_transactions:)
1616
result.map_types!(@type_map_for_results).values
1717
end
1818

0 commit comments

Comments
 (0)