Module: Mysql2::Client::MiniProfiler

Included in:
Mysql2::Client
Defined in:
lib/patches/db/mysql2/prepend.rb

Instance Method Summary collapse

Instance Method Details

#query(*args, &blk) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/patches/db/mysql2/prepend.rb', line 22

def query(*args, &blk)
  return super unless SqlPatches.should_measure?

  result, record = SqlPatches.record_sql(args[0]) do
    super
  end
  result.instance_variable_set("@miniprofiler_sql_id", record) if result
  result
end