Class RailsInstaller::Database
In: lib/rails-installer/databases.rb
lib/rails-installer/databases.rb
Parent: Object

Parent class for database plugins for the installer. To create a new database handler, subclass this class and define a yml class and optionally a create_database method.

Methods

Classes and Modules

Class RailsInstaller::Database::Mysql
Class RailsInstaller::Database::Postgresql
Class RailsInstaller::Database::Sqlite

Public Class methods

Back up the database. This is fully DB and schema agnostic. It serializes all tables to a single YAML file.

Back up the database. This is fully DB and schema agnostic. It serializes all tables to a single YAML file.

Connect to the database (using the ‘database.yml’ generated by the yml method). Returns true if the database already exists, and false if the database doesn‘t exist yet.

Connect to the database (using the ‘database.yml’ generated by the yml method). Returns true if the database already exists, and false if the database doesn‘t exist yet.

Create the database, including schema creation. This should be generic enough that database-specific drivers don‘t need to override it.

It calls create_database to actually build a new DB from scratch if needed.

Create the database, including schema creation. This should be generic enough that database-specific drivers don‘t need to override it.

It calls create_database to actually build a new DB from scratch if needed.

Create a new database from scratch. Some DBs, like SQLite, don‘t need this. Others will need to override this and call the DB‘s "create new database" command.

Create a new database from scratch. Some DBs, like SQLite, don‘t need this. Others will need to override this and call the DB‘s "create new database" command.

Create a ‘database.yml’ file, using the data from yml.

Create a ‘database.yml’ file, using the data from yml.

Inheritence hook

Inheritence hook

Restore a backup created by backup. Deletes all data before importing.

Restore a backup created by backup. Deletes all data before importing.

[Validate]