Sha256: b424b29fc2b9eb323a06a75104c5f8f1993f8d8df51386808011a77c256204a2

Contents?: true

Size: 734 Bytes

Versions: 23

Compression:

Stored size: 734 Bytes

Contents

# Supports 3.12.0+
module Skylight
  module Probes
    module Sequel
      class Probe
        def install
          require 'sequel/database/logging'
          ::Sequel::Database.class_eval do
            alias log_yield_without_sk log_yield

            def log_yield(sql, args=nil, &block)
              log_yield_without_sk(sql, *args) do
                ::ActiveSupport::Notifications.instrument(
                  "sql.sequel",
                  sql: sql,
                  name: "SQL",
                  binds: args
                ) do
                  block.call
                end
              end
            end
          end
        end
      end
    end

    register("Sequel", "sequel", Sequel::Probe.new)
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
skylight-1.0.0.beta4 lib/skylight/probes/sequel.rb
skylight-1.0.0.beta3 lib/skylight/probes/sequel.rb
skylight-0.10.3 lib/skylight/probes/sequel.rb
skylight-0.10.2 lib/skylight/probes/sequel.rb
skylight-1.0.0.beta2 lib/skylight/probes/sequel.rb
skylight-0.10.0 lib/skylight/probes/sequel.rb
skylight-0.9.4 lib/skylight/probes/sequel.rb
skylight-0.9.3 lib/skylight/probes/sequel.rb
skylight-0.9.2 lib/skylight/probes/sequel.rb
skylight-0.9.1 lib/skylight/probes/sequel.rb
skylight-0.9.0 lib/skylight/probes/sequel.rb
skylight-0.8.1 lib/skylight/probes/sequel.rb
skylight-0.8.0 lib/skylight/probes/sequel.rb
skylight-0.8.0.beta.3 lib/skylight/probes/sequel.rb
skylight-0.8.0.beta.1 lib/skylight/probes/sequel.rb
skylight-0.7.1 lib/skylight/probes/sequel.rb
skylight-0.7.0.beta.3 lib/skylight/probes/sequel.rb
truex-skylight-0.6.0 lib/skylight/probes/sequel.rb
skylight-0.7.0.beta.2 lib/skylight/probes/sequel.rb
skylight-0.7.0.beta.1 lib/skylight/probes/sequel.rb