Sha256: df92f6c70dbd2501aa8aaa10030b931e0bf4c1945a738072b8002c5626899178

Contents?: true

Size: 553 Bytes

Versions: 33

Compression:

Stored size: 553 Bytes

Contents

require 'sequel/database/logging'
require 'active_support/notifications'

module ROM
  module SQL
    module ActiveSupportInstrumentation
      def log_connection_yield(sql, _conn, args = nil)
        ActiveSupport::Notifications.instrument(
          'sql.rom',
          sql: sql,
          name: instrumentation_name,
          binds: args
        ) { super }
      end

      private

      def instrumentation_name
        "ROM[#{database_type}]"
      end
    end
  end
end

Sequel::Database.send(:prepend, ROM::SQL::ActiveSupportInstrumentation)

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
rom-sql-3.1.0 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-3.0.1 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-3.0.0 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-2.5.0 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-2.4.0 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-2.3.0 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-2.2.1 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-2.2.0 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-2.1.0 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-2.0.0 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-1.3.5 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-2.0.0.rc1 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-1.3.4 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-2.0.0.beta3 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-2.0.0.beta2 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-2.0.0.beta1 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-1.3.3 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-1.3.2 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-1.3.1 lib/rom/sql/extensions/active_support_notifications.rb
rom-sql-1.3.0 lib/rom/sql/extensions/active_support_notifications.rb