Sha256: 338cf4bf5f944e3b42e3e2cb2f67406d3d7886b54d342663e868eb906fc5e64f

Contents?: true

Size: 526 Bytes

Versions: 19

Compression:

Stored size: 526 Bytes

Contents

module Skylight
  module Normalizers
    class SQL < Normalizer
      register "sql.active_record"

      def normalize(trace, name, payload)
        case payload[:name]
        when "SCHEMA", "CACHE"
          return :skip
        else
          name  = "db.sql.query"
          title = payload[:name]
        end

        binds = payload[:binds]

        annotations = {
          sql:   payload[:sql],
          binds: binds ? binds.map(&:last) : [] }

        [ name, title, nil, annotations ]
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
skylight-0.1.8 lib/skylight/normalizers/sql.rb
skylight-0.1.7 lib/skylight/normalizers/sql.rb
skylight-0.1.7.alpha1 lib/skylight/normalizers/sql.rb
skylight-0.1.6 lib/skylight/normalizers/sql.rb
skylight-0.1.6.alpha3 lib/skylight/normalizers/sql.rb
skylight-0.1.6.alpha1 lib/skylight/normalizers/sql.rb
skylight-0.1.5 lib/skylight/normalizers/sql.rb
skylight-0.1.5.alpha2 lib/skylight/normalizers/sql.rb
skylight-0.1.5.alpha1 lib/skylight/normalizers/sql.rb
skylight-0.1.4 lib/skylight/normalizers/sql.rb
skylight-0.1.4.alpha3 lib/skylight/normalizers/sql.rb
skylight-0.1.4.alpha2 lib/skylight/normalizers/sql.rb
skylight-0.1.4.alpha1 lib/skylight/normalizers/sql.rb
skylight-0.1.3 lib/skylight/normalizers/sql.rb
skylight-0.1.2 lib/skylight/normalizers/sql.rb
skylight-0.1.1 lib/skylight/normalizers/sql.rb
skylight-0.1.0 lib/skylight/normalizers/sql.rb
skylight-0.1.0.alpha2 lib/skylight/normalizers/sql.rb
skylight-0.1.0.alpha1 lib/skylight/normalizers/sql.rb