Class: RailsInstaller::Database::Sqlite

Inherits:
RailsInstaller::Database show all
Defined in:
lib/rails-installer/databases.rb

Overview

The driver for SQLite 3. This is pretty minimal, as all we need is a yml class to provide a basic ‘database.yml’.

Class Method Summary collapse

Methods inherited from RailsInstaller::Database

backup, connect, create, create_database, database_yml, db_host, db_name, db_user, dbs, inherited, restore

Class Method Details

.db_file(installer) ⇒ Object

The name of the sqlite database file



168
169
170
# File 'lib/rails-installer/databases.rb', line 168

def self.db_file(installer)
  File.join(installer.install_directory,'db','database.sqlite')
end

.yml(installer) ⇒ Object



172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/rails-installer/databases.rb', line 172

def self.yml(installer)
  %q{
  login: &login
    adapter: sqlite3
    database: db/database.sqlite

  development:
    <<: *login

  production:
    <<: *login

  test:
    database: ":memory:"
    <<: *login
  }        
end