instance method
execute_and_clear
Ruby on Rails 7.0.10
Since v4.2.9 Last seen in v7.2.3 PrivateSignature
execute_and_clear(sql, name, binds, prepare: false, async: false)
No documentation comment.
Parameters
-
sqlreq -
namereq -
bindsreq -
preparekey = false -
asynckey = false
Source
# File activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 740
def execute_and_clear(sql, name, binds, prepare: false, async: false)
sql = transform_query(sql)
check_if_write_query(sql)
if !prepare || without_prepared_statement?(binds)
result = exec_no_cache(sql, name, binds, async: async)
else
result = exec_cache(sql, name, binds, async: async)
end
begin
ret = yield result
ensure
result.clear
end
ret
end
Defined in activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb line 740
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::PostgreSQLAdapter