| 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 |
Clears connections to the database
# 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
# 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
# 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.
# 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.
# 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
# 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.
# 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