Class: Dump::Postgresql
- Inherits:
-
DatabaseConfig
- Object
- DatabaseConfig
- Dump::Postgresql
- Defined in:
- lib/db_time_machine/dump.rb
Instance Attribute Summary
Attributes inherited from DatabaseConfig
#cmd, #db, #file, #host, #password, #port, #tables, #tmp_folder, #user
Instance Method Summary collapse
Methods inherited from DatabaseConfig
find_adapter, find_config, #initialize
Constructor Details
This class inherits a constructor from Dump::DatabaseConfig
Instance Method Details
#start_dump ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/db_time_machine/dump.rb', line 58 def start_dump self.cmd = "pg_dump " self.cmd = "PGPASSWORD='#{self.password}' "+self.cmd if self.password self.cmd << "-U #{self.user} " if self.user self.cmd << "-h #{self.host} " if self.host self.cmd << "-p #{self.port} " if self.port self.cmd << "#{db} " self.cmd << "-t #{tables.join(' -t ')}" if tables.size > 0 self.cmd << " > #{self.file} " super end |