Module: Oboe::Inst::SequelDataset

Defined in:
lib/oboe/inst/sequel.rb

Overview

module SequelDatabase

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



106
107
108
109
110
111
# File 'lib/oboe/inst/sequel.rb', line 106

def self.included(klass)
  ::Oboe::Util.method_alias(klass, :execute, ::Sequel::Dataset)
  ::Oboe::Util.method_alias(klass, :execute_ddl, ::Sequel::Dataset)
  ::Oboe::Util.method_alias(klass, :execute_dui, ::Sequel::Dataset)
  ::Oboe::Util.method_alias(klass, :execute_insert, ::Sequel::Dataset)
end

Instance Method Details

#exec_with_oboe(method, sql, opts = ::Sequel::OPTS, &block) ⇒ Object



113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/oboe/inst/sequel.rb', line 113

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) ⇒ Object



130
131
132
# File 'lib/oboe/inst/sequel.rb', line 130

def execute_ddl_with_oboe(sql, opts=::Sequel::OPTS, &block)
  exec_with_oboe(:execute_ddl_without_oboe, sql, opts, &block)
end

#execute_dui_with_oboe(sql, opts = ::Sequel::OPTS, &block) ⇒ Object



134
135
136
# File 'lib/oboe/inst/sequel.rb', line 134

def execute_dui_with_oboe(sql, opts=::Sequel::OPTS, &block)
  exec_with_oboe(:execute_dui_without_oboe, sql, opts, &block)
end

#execute_insert_with_oboe(sql, opts = ::Sequel::OPTS, &block) ⇒ Object



138
139
140
# File 'lib/oboe/inst/sequel.rb', line 138

def execute_insert_with_oboe(sql, opts=::Sequel::OPTS, &block)
  exec_with_oboe(:execute_insert_without_oboe, sql, opts, &block)
end

#execute_with_oboe(sql, opts = ::Sequel::OPTS, &block) ⇒ Object



126
127
128
# File 'lib/oboe/inst/sequel.rb', line 126

def execute_with_oboe(sql, opts=::Sequel::OPTS, &block)
  exec_with_oboe(:execute_without_oboe, sql, opts, &block)
end