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



103
104
105
106
107
108
# File 'lib/oboe/inst/sequel.rb', line 103

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



110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/oboe/inst/sequel.rb', line 110

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



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

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



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

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



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

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



123
124
125
# File 'lib/oboe/inst/sequel.rb', line 123

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