Skip to Content Skip to Search

A shareable snapshot of the main-side query outcome.

Methods
C
N
W

Attributes

[R] affected_rows
[R] columns
[R] last_inserted_id
[R] row_count
[R] rows

Class Public methods

new(result, affected_rows, row_count, last_inserted_id, warnings)

# File activerecord/lib/active_record/connection_adapters/ractor_connection_handler/abstract_proxy_adapter/query_response.rb, line 13
def initialize(result, affected_rows, row_count, last_inserted_id, warnings)
  @columns = result.columns
  @rows = result.rows
  @column_types_payload = Proxy.dump_column_types(result)
  @affected_rows = affected_rows
  @row_count = row_count
  @last_inserted_id = last_inserted_id
  @warnings_payload =
    unless warnings.nil? || warnings.empty?
      begin
        Marshal.dump(warnings).freeze
      rescue TypeError
        nil
      end
    end
  ActiveSupport::Ractors.make_shareable(self, copy: false)
end

Instance Public methods

column_types()

# File activerecord/lib/active_record/connection_adapters/ractor_connection_handler/abstract_proxy_adapter/query_response.rb, line 31
def column_types
  @column_types_payload && Marshal.load(@column_types_payload)
end

warnings()

# File activerecord/lib/active_record/connection_adapters/ractor_connection_handler/abstract_proxy_adapter/query_response.rb, line 35
def warnings
  @warnings_payload && Marshal.load(@warnings_payload)
end