method
perform_query
v8.1.1 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::Trilogy::DatabaseStatements
perform_query(raw_connection, sql, binds, type_casted_binds, prepare:, notification_payload:, batch: false)private
No documentation available.
# File activerecord/lib/active_record/connection_adapters/trilogy/database_statements.rb, line 13
def perform_query(raw_connection, sql, binds, type_casted_binds, prepare,, notification_payload,, batch: false)
reset_multi_statement = if batch && !@config[:multi_statement]
raw_connection.set_server_option(::Trilogy::SET_SERVER_MULTI_STATEMENTS_ON)
true
end
# Make sure we carry over any changes to ActiveRecord.default_timezone that have been
# made since we established the connection
if default_timezone == :local
raw_connection.query_flags |= ::Trilogy::QUERY_FLAGS_LOCAL_TIMEZONE
else
raw_connection.query_flags &= ~::Trilogy::QUERY_FLAGS_LOCAL_TIMEZONE
end
result = raw_connection.query(sql)
while raw_connection.more_results_exist?
raw_connection.next_result
end
verified!
notification_payload[:affected_rows] = result.affected_rows
notification_payload[:row_count] = result.count
result
ensure
if reset_multi_statement && active?
raw_connection.set_server_option(::Trilogy::SET_SERVER_MULTI_STATEMENTS_OFF)
end
end