instance method
perform_query
Ruby on Rails edge
Since v8.0.5.1 Private — implementation detail, not part of the public APISignature
perform_query(raw_connection, intent)
No documentation comment.
Parameters
-
raw_connectionreq -
intentreq
Source
# File activerecord/lib/active_record/connection_adapters/trilogy/database_statements.rb, line 21
def perform_query(raw_connection, intent)
reset_multi_statement = if intent.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(intent.processed_sql)
while raw_connection.more_results_exist?
raw_connection.next_result
end
verified!
intent.notification_payload[:affected_rows] = result.affected_rows
intent.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
Defined in activerecord/lib/active_record/connection_adapters/trilogy/database_statements.rb line 21
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::ConnectionAdapters::Trilogy::DatabaseStatements