Sha256: 2a37f0e7cdf8bf4b1517b422abff8cf0b6de11b0ebb952c8fa1d86784a1c3c8f

Contents?: true

Size: 563 Bytes

Versions: 18

Compression:

Stored size: 563 Bytes

Contents

require 'logtail/util'
require 'logtail/event'

module Logtail
  module Events
    # @private
    class SQLQuery < Logtail::Event
      attr_reader :sql, :duration_ms, :message

      def initialize(attributes)
        @sql = attributes[:sql]
        @duration_ms = attributes[:duration_ms]
        @message = attributes[:message]
      end

      def to_hash
        {
          sql_query_executed: Util::NonNilHashBuilder.build do |h|
            h.add(:sql, sql)
            h.add(:duration_ms, duration_ms)
          end
        }
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
logtail-ruby-0.1.3 lib/logtail/events/sql_query.rb
logtail-0.1.13 lib/logtail/events/sql_query.rb
logtail-0.1.12 lib/logtail/events/sql_query.rb
logtail-0.1.11 lib/logtail/events/sql_query.rb
logtail-0.1.10 lib/logtail/events/sql_query.rb
logtail-0.1.9 lib/logtail/events/sql_query.rb
logtail-0.1.8 lib/logtail/events/sql_query.rb
logtail-0.1.7 lib/logtail/events/sql_query.rb
logtail-0.1.6 lib/logtail/events/sql_query.rb
logtail-0.1.5 lib/logtail/events/sql_query.rb
logtail-0.1.4 lib/logtail/events/sql_query.rb
logtail-0.1.3 lib/logtail/events/sql_query.rb
logtail-0.1.2 lib/logtail/events/sql_query.rb
logtail-0.1.1 lib/logtail/events/sql_query.rb
logtail-0.1.0 lib/logtail/events/sql_query.rb
logtail-ruby-0.1.2 lib/logtail/events/sql_query.rb
logtail-ruby-0.1.1 lib/logtail/events/sql_query.rb
logtail-ruby-0.1.0 lib/logtail/events/sql_query.rb