Sha256: b60c846bd044c1de051d9c322abc027949cea6d37a8909203faca9247866b915

Contents?: true

Size: 1000 Bytes

Versions: 11

Compression:

Stored size: 1000 Bytes

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.

module NewRelic
  module Agent
    module Instrumentation
      module SequelHelper
        extend self

        # Fallback if the product cannot be determined
        DEFAULT_PRODUCT_NAME = "Sequel".freeze

        # A Sequel adapter is called an "adapter_scheme" and can be accessed from
        # the database:
        #
        #   DB.adapter_scheme
        PRODUCT_NAMES = {
          :ibmdb => "IBMDB2",
          :firebird => "Firebird",
          :informix => "Informix",
          :jdbc => "JDBC",
          :mysql => "MySQL",
          :mysql2 => "MySQL",
          :oracle => "Oracle",
          :postgres => "Postgres",
          :sqlite => "SQLite"
        }.freeze

        def product_name_from_adapter(adapter)
          PRODUCT_NAMES.fetch(adapter, DEFAULT_PRODUCT_NAME)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
newrelic_rpm-8.2.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.1.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.0.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-7.2.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-7.1.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-7.0.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-6.15.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-6.14.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-6.13.1 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-6.13.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-6.12.0.367 lib/new_relic/agent/instrumentation/sequel_helper.rb