method
execute_and_clear
rails latest stable - Class:
ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
execute_and_clear(sql, name, binds, prepare: false, async: false, allow_retry: false, materialize_transactions: true)private
No documentation available.
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 867
def execute_and_clear(sql, name, binds, prepare: false, async: false, allow_retry: false, materialize_transactions: true)
sql = transform_query(sql)
check_if_write_query(sql)
if !prepare || without_prepared_statement?(binds)
result = exec_no_cache(sql, name, binds, async: async, allow_retry: allow_retry, materialize_transactions: materialize_transactions)
else
result = exec_cache(sql, name, binds, async: async, allow_retry: allow_retry, materialize_transactions: materialize_transactions)
end
begin
ret = yield result
ensure
result.clear
end
ret
end