Class: BiblioTech::Builders::Postgres::Export

Inherits:
Export show all
Defined in:
lib/bibliotech/builders/postgres.rb

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Export

registry_host

Methods inherited from Database

find_class

Methods inherited from Base

adapter_registry, for, #initialize, null_adapter, register, registry, supported_adapters

Constructor Details

This class inherits a constructor from BiblioTech::Builders::Base

Instance Method Details

#go(command) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/bibliotech/builders/postgres.rb', line 11

def go(command)
  command.from('pg_dump', '-Fc')
  config.optional{ command.options << "-h #{config.host}" }
  config.optional{ command.env["PGPASSWORD"] = config.password }
  config.optional{ command.options << "-p #{config.port}" } #ok

  if config.local == "development"
    config.optional{ command.options << "-U #{config.username}" }
  else
    command.options << "-U #{config.username}"
  end

  command.options << "#{config.database}"
  command
end