Module: Sequel::TracingDataset
- Defined in:
- lib/sequel/extensions/dataset_instrumentation.rb
Constant Summary collapse
- OPTS =
datasets are included, not extended
{}.freeze
Instance Method Summary collapse
- #execute(sql, opts = OPTS, &block) ⇒ Object
- #execute_dui(sql, opts = OPTS, &block) ⇒ Object
- #execute_insert(sql, opts = OPTS, &block) ⇒ Object
- #populate_tracing_tags(sql) ⇒ Object
Instance Method Details
#execute(sql, opts = OPTS, &block) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/sequel/extensions/dataset_instrumentation.rb', line 9 def execute(sql, opts = OPTS, &block) = (sql) ::Sequel::Instrumentation.trace_query('sequel.dataset.execute', ) do super end end |
#execute_dui(sql, opts = OPTS, &block) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/sequel/extensions/dataset_instrumentation.rb', line 17 def execute_dui(sql, opts = OPTS, &block) = (sql) ::Sequel::Instrumentation.trace_query('sequel.dataset.execute', ) do super end end |
#execute_insert(sql, opts = OPTS, &block) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/sequel/extensions/dataset_instrumentation.rb', line 25 def execute_insert(sql, opts = OPTS, &block) = (sql) ::Sequel::Instrumentation.trace_query('sequel.dataset.execute_insert', ) do super end end |
#populate_tracing_tags(sql) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/sequel/extensions/dataset_instrumentation.rb', line 33 def (sql) = { 'db.type' => @db.database_type.to_s, 'db.statement' => sql, } ['db.instance'] = @opts[:from].first.to_s if @opts[:from] && !@opts[:from].empty? end |