Class: Avm::Postgresql::Instance
- Defined in:
- lib/avm/postgresql/instance.rb,
lib/avm/postgresql/instance/data_unit.rb
Defined Under Namespace
Classes: DataUnit
Instance Method Summary collapse
- #data_unit ⇒ Object
- #dump_command ⇒ Object
- #dump_gzip_command ⇒ Object
-
#initialize(env, connection_params) ⇒ Instance
constructor
A new instance of Instance.
- #psql_command ⇒ Object
- #psql_command_command(sql) ⇒ Object
Constructor Details
#initialize(env, connection_params) ⇒ Instance
Returns a new instance of Instance.
8 9 10 11 |
# File 'lib/avm/postgresql/instance.rb', line 8 def initialize(env, connection_params) @env = env @connection_params = connection_params.with_indifferent_access end |
Instance Method Details
#data_unit ⇒ Object
13 14 15 |
# File 'lib/avm/postgresql/instance.rb', line 13 def data_unit ::Avm::Postgresql::Instance::DataUnit.new(self) end |
#dump_command ⇒ Object
17 18 19 20 |
# File 'lib/avm/postgresql/instance.rb', line 17 def dump_command env.command('pg_dump', '--no-privileges', '--clean', '--no-owner', *common_command_args) .envvar('PGPASSWORD', password) end |
#dump_gzip_command ⇒ Object
22 23 24 |
# File 'lib/avm/postgresql/instance.rb', line 22 def dump_gzip_command dump_command.append(['@ESC_|', 'gzip', '-9', '-c']) end |
#psql_command ⇒ Object
26 27 28 |
# File 'lib/avm/postgresql/instance.rb', line 26 def psql_command env.command("@ESC_PGPASSWORD=#{password}", 'psql', *common_command_args) end |
#psql_command_command(sql) ⇒ Object
30 31 32 |
# File 'lib/avm/postgresql/instance.rb', line 30 def psql_command_command(sql) psql_command.append(['--quiet', '--tuples-only', '--command', sql]) end |