Module Mack::Database
In: lib/mack-orm/database.rb
lib/mack-orm/database_migrations.rb
lib/mack-orm/generators.rb
lib/mack-orm/paginator.rb

Methods

Classes and Modules

Module Mack::Database::Generators
Module Mack::Database::Migrations
Class Mack::Database::Paginator

Public Class methods

Clears connections to the database

[Source]

    # File lib/mack-orm/database.rb, line 11
11:     def self.clear_connection(env = Mack.env)
12:       raise NoMethodError.new(:clear_connection)
13:     end

Creates a database, if it doesn‘t already exist for the specified environment

[Source]

    # File lib/mack-orm/database.rb, line 16
16:     def self.create(env = Mack.env, repis = :default)
17:       raise NoMethodError.new(:create)
18:     end

Drops a database, if it exists for the specified environment

[Source]

    # File lib/mack-orm/database.rb, line 21
21:     def self.drop(env = Mack.env, repis = :default)
22:       raise NoMethodError.new(:drop)
23:     end

Dumps the structure of the database to a file.

[Source]

    # File lib/mack-orm/database.rb, line 37
37:     def self.dump_structure(env = Mack.env, repis = :default)
38:       raise NoMethodError.new(:dump_structure)
39:     end

Sets up and establishes connections to the database based on the specified environment and the settings in the database.yml file.

[Source]

   # File lib/mack-orm/database.rb, line 6
6:     def self.establish_connection(env = Mack.env)
7:       raise NoMethodError.new(:establish_connection)
8:     end

Loads the structure of the given file into the database

[Source]

    # File lib/mack-orm/database.rb, line 32
32:     def self.load_structure(file, env = Mack.env, repis = :default)
33:       raise NoMethodError.new(:load_structure)
34:     end

Creates a new Mack::Database::Paginator class and calls the paginate method on it.

[Source]

   # File lib/mack-orm/paginator.rb, line 5
5:     def self.paginate(klass, options = {}, query_options = {})
6:       paginator = Mack::Database::Paginator.new(klass, options, query_options)
7:       paginator.paginate
8:     end

Drops and then creates the database.

[Source]

    # File lib/mack-orm/database.rb, line 26
26:     def self.recreate(env = Mack.env, repis = :default)
27:       Mack::Database.drop(env, repis)
28:       Mack::Database.create(env, repis)
29:     end

[Validate]