Sha256: 5d580f09f77ff2b0e8f1fb6bbbe83e8cb375ac0622f6e6b9b5d49cf49fc3c880

Contents?: true

Size: 511 Bytes

Versions: 7

Compression:

Stored size: 511 Bytes

Contents

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

      def normalize
        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

7 entries across 7 versions & 1 rubygems

Version Path
skylight-0.0.16 lib/skylight/normalize/sql.rb
skylight-0.0.15 lib/skylight/normalize/sql.rb
skylight-0.0.14 lib/skylight/normalize/sql.rb
skylight-0.0.13 lib/skylight/normalize/sql.rb
skylight-0.0.12 lib/skylight/normalize/sql.rb
skylight-0.0.11 lib/skylight/normalize/sql.rb
skylight-0.0.10 lib/skylight/normalize/sql.rb