Class: Sequel::Rails::Storage::Postgres
- Inherits:
-
Sequel::Rails::Storage
- Object
- Sequel::Rails::Storage
- Sequel::Rails::Storage::Postgres
- Defined in:
- lib/sequel/rails/storage.rb
Instance Attribute Summary
Attributes inherited from Sequel::Rails::Storage
Instance Method Summary collapse
Methods inherited from Sequel::Rails::Storage
#charset, #create, create_all, create_environment, #database, #drop, drop_all, drop_environment, #host, #initialize, new, #owner, #password, #port, #username
Constructor Details
This class inherits a constructor from Sequel::Rails::Storage
Instance Method Details
#_create ⇒ Object
162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/sequel/rails/storage.rb', line 162 def _create ENV["PGPASSWORD"] = password unless password.blank? commands = ["createdb", "--encoding", charset] commands << "--username" << username unless username.blank? commands << "--owner" << owner unless owner.blank? commands << "--port" << port unless port.blank? commands << "--host" << host unless host.blank? commands << database res = system(*commands) ENV["PGPASSWORD"] = nil res end |
#_drop ⇒ Object
175 176 177 |
# File 'lib/sequel/rails/storage.rb', line 175 def _drop system("dropdb", "-U", username, database) end |