Module: Sixty::Instrument::Mysql::Mysql2Patch

Defined in:
lib/sixty/instrument/mysql.rb

Instance Method Summary collapse

Instance Method Details

#query(*args, &block) ⇒ Object



167
168
169
170
171
172
173
174
175
# File 'lib/sixty/instrument/mysql.rb', line 167

def query(*args, &block)
  # `stream: true` can come from the call or from the client's defaults,
  # and either one means the rows are not there yet.
  options = args[1].is_a?(Hash) ? args[1] : {}
  streaming = options[:stream] || (query_options.is_a?(Hash) && query_options[:stream])
  Sixty::Instrument::Mysql.measure(
    args.first, connection: self, count_rows: !streaming
  ) { super }
end