module Oboe::Inst::SequelDatabase

Public Class Methods

included(klass) click to toggle source
# File lib/oboe/inst/sequel.rb, line 46
def self.included(klass)
  ::Oboe::Util.method_alias(klass, :run, ::Sequel::Database)
  ::Oboe::Util.method_alias(klass, :execute_ddl, ::Sequel::Database)
  ::Oboe::Util.method_alias(klass, :execute_dui, ::Sequel::Database)
  ::Oboe::Util.method_alias(klass, :execute_insert, ::Sequel::Database)
end

Public Instance Methods

exec_with_oboe(method, sql, opts=::Sequel::OPTS, &block) click to toggle source
# File lib/oboe/inst/sequel.rb, line 66
def exec_with_oboe(method, sql, opts=::Sequel::OPTS, &block)
  kvs = extract_trace_details(sql, opts)

  Oboe::API.log_entry('sequel', kvs)

  send(method, sql, opts, &block)
rescue => e
  Oboe::API.log_exception('sequel', e)
  raise e
ensure
  Oboe::API.log_exit('sequel')
end
execute_ddl_with_oboe(sql, opts=::Sequel::OPTS, &block) click to toggle source
# File lib/oboe/inst/sequel.rb, line 79
def execute_ddl_with_oboe(sql, opts=::Sequel::OPTS, &block)
  # If we're already tracing a sequel operation, then this call likely came
  # from Sequel::Dataset.  In this case, just pass it on.
  return execute_ddl_without_oboe(sql, opts, &block) if Oboe.tracing_layer?('sequel')

  exec_with_oboe(:execute_ddl_without_oboe, sql, opts, &block)
end
execute_dui_with_oboe(sql, opts=::Sequel::OPTS, &block) click to toggle source
# File lib/oboe/inst/sequel.rb, line 87
def execute_dui_with_oboe(sql, opts=::Sequel::OPTS, &block)
  # If we're already tracing a sequel operation, then this call likely came
  # from Sequel::Dataset.  In this case, just pass it on.
  return execute_dui_without_oboe(sql, opts, &block) if Oboe.tracing_layer?('sequel')

  exec_with_oboe(:execute_dui_without_oboe, sql, opts, &block)
end
execute_insert_with_oboe(sql, opts=::Sequel::OPTS, &block) click to toggle source
# File lib/oboe/inst/sequel.rb, line 95
def execute_insert_with_oboe(sql, opts=::Sequel::OPTS, &block)
  # If we're already tracing a sequel operation, then this call likely came
  # from Sequel::Dataset.  In this case, just pass it on.
  return execute_insert_without_oboe(sql, opts, &block) if Oboe.tracing_layer?('sequel')

  exec_with_oboe(:execute_insert_without_oboe, sql, opts, &block)
end
run_with_oboe(sql, opts=::Sequel::OPTS) click to toggle source
# File lib/oboe/inst/sequel.rb, line 53
def run_with_oboe(sql, opts=::Sequel::OPTS)
  kvs = extract_trace_details(sql, opts)

  Oboe::API.log_entry('sequel', kvs)

  run_without_oboe(sql, opts)
rescue => e
  Oboe::API.log_exception('sequel', e)
  raise e
ensure
  Oboe::API.log_exit('sequel')
end