Class: PgExport::Bash::Adapter
- Inherits:
-
Object
- Object
- PgExport::Bash::Adapter
- Defined in:
- lib/pg_export/bash/adapter.rb
Instance Method Summary collapse
Instance Method Details
#get(path, db_name) ⇒ Object
7 8 9 10 11 |
# File 'lib/pg_export/bash/adapter.rb', line 7 def get(path, db_name) popen("pg_dump -Fc --file #{path} #{db_name}") do |errors| raise PgDumpError, errors unless errors.empty? end end |
#persist(path, db_name) ⇒ Object
13 14 15 16 17 |
# File 'lib/pg_export/bash/adapter.rb', line 13 def persist(path, db_name) popen("pg_restore -c -d #{db_name} #{path}") do |errors| raise PgRestoreError, errors if /FATAL/ =~ errors end end |