123456789_123456789_123456789_123456789_123456789_

Class: Rails::Generators::Database

Relationships & Source Files
Namespace Children
Modules:
Classes:
Extension / Inclusion / Inheritance Descendants
Subclasses:
Inherits: Object
Defined in: railties/lib/rails/generators/database.rb

Constant Summary

Class Method Summary

Instance Method Summary

Class Method Details

.all

[ GitHub ]

  
# File 'railties/lib/rails/generators/database.rb', line 19

def all
  @all ||= [
    MySQL.new,
    PostgreSQL.new,
    MariaDB.new,
    SQLite3.new,
  ]
end

.build(database_name)

[ GitHub ]

  
# File 'railties/lib/rails/generators/database.rb', line 9

def build(database_name)
  case database_name
  when "mysql" then MySQL.new
  when "postgresql" then PostgreSQL.new
  when "trilogy" then MariaDB.new
  when "sqlite3" then SQLite3.new
  else Null.new
  end
end

Instance Method Details

#base_package

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'railties/lib/rails/generators/database.rb', line 49

def base_package
  raise NotImplementedError
end

#build_package

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'railties/lib/rails/generators/database.rb', line 53

def build_package
  raise NotImplementedError
end

#feature

[ GitHub ]

  
# File 'railties/lib/rails/generators/database.rb', line 60

def feature
  return unless feature_name

  { feature_name => {} }
end

#feature_name

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'railties/lib/rails/generators/database.rb', line 41

def feature_name
  raise NotImplementedError
end

#gem

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'railties/lib/rails/generators/database.rb', line 45

def gem
  raise NotImplementedError
end

#host

[ GitHub ]

  
# File 'railties/lib/rails/generators/database.rb', line 58

def host; end

#name

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'railties/lib/rails/generators/database.rb', line 29

def name
  raise NotImplementedError
end

#port

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'railties/lib/rails/generators/database.rb', line 37

def port
  raise NotImplementedError
end

#service

Raises:

  • (NotImplementedError)
[ GitHub ]

  
# File 'railties/lib/rails/generators/database.rb', line 33

def service
  raise NotImplementedError
end

#socket

[ GitHub ]

  
# File 'railties/lib/rails/generators/database.rb', line 57

def socket; end

#volume

[ GitHub ]

  
# File 'railties/lib/rails/generators/database.rb', line 66

def volume
  return unless service

  "#{name}-data"
end