Class: DB2Fog::PsqlAdaptor

Inherits:
BaseAdaptor show all
Defined in:
lib/db2fog.rb

Instance Method Summary collapse

Methods inherited from BaseAdaptor

#dump, #initialize, #run

Constructor Details

This class inherits a constructor from DB2Fog::BaseAdaptor

Instance Method Details

#dump_command(dump_file) ⇒ Object



134
135
136
137
# File 'lib/db2fog.rb', line 134

def dump_command(dump_file)
  cmd = "pg_dump --clean --format=p --compress=9 #{pg_dump_options}"
  cmd += " > #{dump_file.path}"
end

#restore(path) ⇒ Object



139
140
141
# File 'lib/db2fog.rb', line 139

def restore(path)
  run "gunzip -c #{path} | psql #{psql_options}"
end