Class: Dumpman::Adapters::Pg
- Inherits:
-
Base
- Object
- Base
- Dumpman::Adapters::Pg
show all
- Defined in:
- lib/dumpman/adapters/pg.rb
Instance Method Summary
collapse
Methods inherited from Base
create_cmd, drop_cmd, dump_cmd, restore_cmd
Instance Method Details
#create_cmd ⇒ Object
16
17
18
|
# File 'lib/dumpman/adapters/pg.rb', line 16
def create_cmd
"PGPASSWORD='#{password}' createdb -h #{host} --username '#{username}' #{database}"
end
|
#drop_cmd ⇒ Object
12
13
14
|
# File 'lib/dumpman/adapters/pg.rb', line 12
def drop_cmd
"PGPASSWORD='#{password}' dropdb -h #{host} --username '#{username}' #{database}"
end
|
#dump_cmd ⇒ Object
4
5
6
|
# File 'lib/dumpman/adapters/pg.rb', line 4
def dump_cmd
"PGPASSWORD='#{password}' pg_dump -h #{host} --username '#{username}' --verbose --clean --no-owner --no-acl -Z4 -Fc #{database} > '#{Dumpman.dump_file}'"
end
|
#restore_cmd ⇒ Object
8
9
10
|
# File 'lib/dumpman/adapters/pg.rb', line 8
def restore_cmd
"PGPASSWORD='#{password}' pg_restore -h #{host} --username '#{username}' --verbose --clean --no-owner --no-acl -j 4 -d #{database} '#{Dumpman.dump_file}'"
end
|