Sha256: 1a9ff9478ea716e1f070a4a1de404752001d1ef08ec79b738dfb1d355c468115

Contents?: true

Size: 1001 Bytes

Versions: 7

Compression:

Stored size: 1001 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

7 entries across 7 versions & 1 rubygems

Version Path
newrelic_rpm-8.9.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.8.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.7.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.6.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.5.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.4.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.3.0 lib/new_relic/agent/instrumentation/sequel_helper.rb