Skip to Content Skip to Search

class Rails::Generators::Database

Constants

%w( mysql trilogy postgresql sqlite3 )

Public class methods

Source code GitHub
# File railties/lib/rails/generators/database.rb, line 19
def all
  @all ||= [
    MySQL.new,
    PostgreSQL.new,
    MariaDB.new,
    SQLite3.new,
  ]
end
Source code 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

Public instance methods

Source code GitHub
# File railties/lib/rails/generators/database.rb, line 49
def base_package
  raise NotImplementedError
end
Source code GitHub
# File railties/lib/rails/generators/database.rb, line 53
def build_package
  raise NotImplementedError
end
Source code GitHub
# File railties/lib/rails/generators/database.rb, line 60
def feature
  return unless feature_name

  { feature_name => {} }
end
Source code GitHub
# File railties/lib/rails/generators/database.rb, line 41
def feature_name
  raise NotImplementedError
end
Source code GitHub
# File railties/lib/rails/generators/database.rb, line 45
def gem
  raise NotImplementedError
end
Source code GitHub
# File railties/lib/rails/generators/database.rb, line 58
def host; end
Source code GitHub
# File railties/lib/rails/generators/database.rb, line 29
def name
  raise NotImplementedError
end
Source code GitHub
# File railties/lib/rails/generators/database.rb, line 37
def port
  raise NotImplementedError
end
Source code GitHub
# File railties/lib/rails/generators/database.rb, line 33
def service
  raise NotImplementedError
end
Source code GitHub
# File railties/lib/rails/generators/database.rb, line 57
def socket; end
Source code GitHub
# File railties/lib/rails/generators/database.rb, line 66
def volume
  return unless service

  "#{name}-data"
end

Namespace

Definition files