Class: ActiveRecord::DatabaseConfigurations::DatabaseConfig

Inherits:
Object
  • Object
show all
Defined in:
activerecord/lib/active_record/database_configurations/database_config.rb

Overview

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.

Direct Known Subclasses

HashConfig

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env_name, name) ⇒ DatabaseConfig

Returns a new instance of DatabaseConfig.



11
12
13
14
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 11

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

Instance Attribute Details

#env_nameObject (readonly)

Returns the value of attribute env_name



9
10
11
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 9

def env_name
  @env_name
end

#nameObject (readonly)

Returns the value of attribute name



9
10
11
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 9

def name
  @name
end

Instance Method Details

#_database=(database) ⇒ Object

Raises:

  • (NotImplementedError)


32
33
34
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 32

def _database=(database)
  raise NotImplementedError
end

#adapterObject

Raises:

  • (NotImplementedError)


36
37
38
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 36

def adapter
  raise NotImplementedError
end

#adapter_class_methodObject



20
21
22
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 20

def adapter_class_method
  "#{adapter}_adapter_class"
end

#adapter_methodObject



16
17
18
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 16

def adapter_method
  "#{adapter}_connection"
end

#checkout_timeoutObject

Raises:

  • (NotImplementedError)


56
57
58
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 56

def checkout_timeout
  raise NotImplementedError
end

#databaseObject

Raises:

  • (NotImplementedError)


28
29
30
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 28

def database
  raise NotImplementedError
end

#for_current_env?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 76

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

#hostObject

Raises:

  • (NotImplementedError)


24
25
26
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 24

def host
  raise NotImplementedError
end

#idle_timeoutObject

Raises:

  • (NotImplementedError)


64
65
66
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 64

def idle_timeout
  raise NotImplementedError
end

#max_queueObject

Raises:

  • (NotImplementedError)


52
53
54
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 52

def max_queue
  raise NotImplementedError
end

#max_threadsObject

Raises:

  • (NotImplementedError)


48
49
50
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 48

def max_threads
  raise NotImplementedError
end

#migrations_pathsObject

Raises:

  • (NotImplementedError)


72
73
74
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 72

def migrations_paths
  raise NotImplementedError
end

#min_threadsObject

Raises:

  • (NotImplementedError)


44
45
46
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 44

def min_threads
  raise NotImplementedError
end

#poolObject

Raises:

  • (NotImplementedError)


40
41
42
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 40

def pool
  raise NotImplementedError
end

#reaping_frequencyObject

Raises:

  • (NotImplementedError)


60
61
62
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 60

def reaping_frequency
  raise NotImplementedError
end

#replica?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


68
69
70
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 68

def replica?
  raise NotImplementedError
end

#schema_cache_pathObject

Raises:

  • (NotImplementedError)


80
81
82
# File 'activerecord/lib/active_record/database_configurations/database_config.rb', line 80

def schema_cache_path
  raise NotImplementedError
end