Class: Rails::Generators::Database
- Inherits:
-
Object
- Object
- Rails::Generators::Database
show all
- Defined in:
- lib/rails/generators/database.rb
Defined Under Namespace
Modules: MariaDB, MySQL
Classes: MariaDBMySQL2, MariaDBTrilogy, MySQL2, Null, PostgreSQL, SQLite3, Trilogy
Constant Summary
collapse
- DATABASES =
%w( mysql trilogy postgresql sqlite3 mariadb-mysql mariadb-trilogy )
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.build(database_name) ⇒ Object
72
73
74
75
76
77
78
79
80
81
82
|
# File 'lib/rails/generators/database.rb', line 72
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 Method Details
#base_package ⇒ Object
119
120
121
|
# File 'lib/rails/generators/database.rb', line 119
def base_package
raise NotImplementedError
end
|
#build_package ⇒ Object
123
124
125
|
# File 'lib/rails/generators/database.rb', line 123
def build_package
raise NotImplementedError
end
|
#feature ⇒ Object
130
131
132
133
134
|
# File 'lib/rails/generators/database.rb', line 130
def feature
return unless feature_name
{ feature_name => {} }
end
|
#feature_name ⇒ Object
111
112
113
|
# File 'lib/rails/generators/database.rb', line 111
def feature_name
raise NotImplementedError
end
|
#gem ⇒ Object
115
116
117
|
# File 'lib/rails/generators/database.rb', line 115
def gem
raise NotImplementedError
end
|
#host ⇒ Object
128
|
# File 'lib/rails/generators/database.rb', line 128
def host; end
|
#name ⇒ Object
95
96
97
|
# File 'lib/rails/generators/database.rb', line 95
def name
raise NotImplementedError
end
|
#port ⇒ Object
107
108
109
|
# File 'lib/rails/generators/database.rb', line 107
def port
raise NotImplementedError
end
|
#service ⇒ Object
103
104
105
|
# File 'lib/rails/generators/database.rb', line 103
def service
raise NotImplementedError
end
|
#socket ⇒ Object
127
|
# File 'lib/rails/generators/database.rb', line 127
def socket; end
|
#template ⇒ Object
99
100
101
|
# File 'lib/rails/generators/database.rb', line 99
def template
raise NotImplementedError
end
|
#volume ⇒ Object
136
137
138
139
140
|
# File 'lib/rails/generators/database.rb', line 136
def volume
return unless service
"#{name}-data"
end
|