Module: ActiveRecordPostgresRecovery::PostgresqlAdapterPatch

Defined in:
lib/active_record_postgres_recovery/postgresql_adapter_patch.rb

Constant Summary collapse

SOURCE =
'ActiveRecord'
QUERY_EXCEPTIONS =
[ActiveRecord::StatementInvalid, ActiveRecord::ConnectionNotEstablished, PG::ConnectionBad].freeze
RECONNECT_EXCEPTIONS =
[ActiveRecord::ConnectionNotEstablished, PG::ConnectionBad].freeze

Instance Method Summary collapse

Instance Method Details

#execute(sql, name = nil) ⇒ Object



24
25
26
27
28
# File 'lib/active_record_postgres_recovery/postgresql_adapter_patch.rb', line 24

def execute(sql, name = nil)
  active_record_postgres_recovery_with_retry(sql, active_record_postgres_recovery_context(name)) do
    super
  end
end

#execute_and_clear(sql, name, binds, prepare: false, async: false, &block) ⇒ Object



12
13
14
15
16
# File 'lib/active_record_postgres_recovery/postgresql_adapter_patch.rb', line 12

def execute_and_clear(sql, name, binds, prepare: false, async: false, &block)
  active_record_postgres_recovery_with_retry(sql, active_record_postgres_recovery_context(name)) do
    super
  end
end

#query(sql, name = nil) ⇒ Object



18
19
20
21
22
# File 'lib/active_record_postgres_recovery/postgresql_adapter_patch.rb', line 18

def query(sql, name = nil)
  active_record_postgres_recovery_with_retry(sql, active_record_postgres_recovery_context(name)) do
    super
  end
end