Skip to Content Skip to Search
Namespace
Methods
A
B
F
G
H
N
P
S
T
V

Constants

DATABASES = %w( mysql trilogy postgresql sqlite3 mariadb-mysql mariadb-trilogy ).freeze
 

Class Public methods

all()

# File railties/lib/rails/generators/database.rb, line 70
def all
  @all ||= [
    MySQL2.new,
    PostgreSQL.new,
    SQLite3.new,
    MariaDBMySQL2.new,
    MariaDBTrilogy.new
  ]
end

build(database_name)

# File railties/lib/rails/generators/database.rb, line 58
def build(database_name)
  case database_name
  when "mysql" then MySQL2.new
  when "postgresql" then PostgreSQL.new
  when "trilogy" then Trilogy.new
  when "sqlite3" then SQLite3.new
  when "mariadb-mysql" then MariaDBMySQL2.new
  when "mariadb-trilogy" then MariaDBTrilogy.new
  else Null.new
  end
end

Instance Public methods

base_package()

# File railties/lib/rails/generators/database.rb, line 105
def base_package
  raise NotImplementedError
end

build_package()

# File railties/lib/rails/generators/database.rb, line 109
def build_package
  raise NotImplementedError
end

feature()

# File railties/lib/rails/generators/database.rb, line 115
def feature
  return unless feature_name

  { feature_name => {} }
end

feature_name()

# File railties/lib/rails/generators/database.rb, line 97
def feature_name
  raise NotImplementedError
end

gem()

# File railties/lib/rails/generators/database.rb, line 101
def gem
  raise NotImplementedError
end

host()

# File railties/lib/rails/generators/database.rb, line 113
def host; end

name()

# File railties/lib/rails/generators/database.rb, line 81
def name
  raise NotImplementedError
end

port()

# File railties/lib/rails/generators/database.rb, line 93
def port
  raise NotImplementedError
end

service()

# File railties/lib/rails/generators/database.rb, line 89
def service
  raise NotImplementedError
end

template()

# File railties/lib/rails/generators/database.rb, line 85
def template
  raise NotImplementedError
end

volume()

# File railties/lib/rails/generators/database.rb, line 121
def volume
  return unless service

  "#{name}-data"
end