Sha256: d5b59d52e7322aa775bd63b3803eaaeb03b955e04598d85b8bda4ab71df0b782

Contents?: true

Size: 1.73 KB

Versions: 18

Compression:

Stored size: 1.73 KB

Contents

# frozen_string_literal: true

module ActiveRecord
  class DatabaseConfigurations
    # ActiveRecord::Base.configurations will return either a HashConfig or
    # UrlConfig respectively. It will never return a +DatabaseConfig+ object,
    # as this is the parent class for the types of database configuration objects.
    class DatabaseConfig # :nodoc:
      attr_reader :env_name, :name

      def initialize(env_name, name)
        @env_name = env_name
        @name = name
      end

      def adapter_method
        "#{adapter}_connection"
      end

      def adapter_class_method
        "#{adapter}_adapter_class"
      end

      def host
        raise NotImplementedError
      end

      def database
        raise NotImplementedError
      end

      def _database=(database)
        raise NotImplementedError
      end

      def adapter
        raise NotImplementedError
      end

      def pool
        raise NotImplementedError
      end

      def min_threads
        raise NotImplementedError
      end

      def max_threads
        raise NotImplementedError
      end

      def max_queue
        raise NotImplementedError
      end

      def query_cache
        raise NotImplementedError
      end

      def checkout_timeout
        raise NotImplementedError
      end

      def reaping_frequency
        raise NotImplementedError
      end

      def idle_timeout
        raise NotImplementedError
      end

      def replica?
        raise NotImplementedError
      end

      def migrations_paths
        raise NotImplementedError
      end

      def for_current_env?
        env_name == ActiveRecord::ConnectionHandling::DEFAULT_ENV.call
      end

      def schema_cache_path
        raise NotImplementedError
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 4 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.3.4/lib/active_record/database_configurations/database_config.rb
activerecord-7.1.5.1 lib/active_record/database_configurations/database_config.rb
activerecord-7.1.5 lib/active_record/database_configurations/database_config.rb
activerecord-7.1.4.2 lib/active_record/database_configurations/database_config.rb
activerecord-7.1.4.1 lib/active_record/database_configurations/database_config.rb
activerecord-7.1.4 lib/active_record/database_configurations/database_config.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/activerecord-7.1.3.4/lib/active_record/database_configurations/database_config.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.3.4/lib/active_record/database_configurations/database_config.rb
activerecord-7.1.3.4 lib/active_record/database_configurations/database_config.rb
activerecord-7.1.3.2 lib/active_record/database_configurations/database_config.rb
activerecord-7.1.3.1 lib/active_record/database_configurations/database_config.rb
activerecord-7.1.3 lib/active_record/database_configurations/database_config.rb
activerecord-7.1.2 lib/active_record/database_configurations/database_config.rb
activerecord-7.1.1 lib/active_record/database_configurations/database_config.rb
activerecord-7.1.0 lib/active_record/database_configurations/database_config.rb
activerecord-7.1.0.rc2 lib/active_record/database_configurations/database_config.rb
activerecord-7.1.0.rc1 lib/active_record/database_configurations/database_config.rb
activerecord-7.1.0.beta1 lib/active_record/database_configurations/database_config.rb