Sha256: eb35d7ef2ac9e6755adbe2cb366c95696070dfa6b0c60c3e8002713fce624f74

Contents?: true

Size: 1013 Bytes

Versions: 8

Compression:

Stored size: 1013 Bytes

Contents

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

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

8 entries across 8 versions & 1 rubygems

Version Path
newrelic_rpm-9.0.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.16.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.15.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.14.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.13.1 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.13.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.12.0 lib/new_relic/agent/instrumentation/sequel_helper.rb
newrelic_rpm-8.11.0 lib/new_relic/agent/instrumentation/sequel_helper.rb