Class: StellarCoreBackup::Restore::Database

Inherits:
Database
  • Object
show all
Includes:
Contracts
Defined in:
lib/stellar-core-backup/restore/database.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Database

#backup

Constructor Details

#initialize(config) ⇒ Database

Returns a new instance of Database.



10
11
12
13
14
15
# File 'lib/stellar-core-backup/restore/database.rb', line 10

def initialize(config)
  @config       = config
  @working_dir  = StellarCoreBackup::Utils.create_working_dir(@config.get('working_dir'))
  @dbname       = check_db_connection
  @cmd          = StellarCoreBackup::Cmd.new(@working_dir)
end

Instance Attribute Details

#dbnameObject (readonly)

Returns the value of attribute dbname.



7
8
9
# File 'lib/stellar-core-backup/restore/database.rb', line 7

def dbname
  @dbname
end

Instance Method Details

#restoreObject



19
20
21
# File 'lib/stellar-core-backup/restore/database.rb', line 19

def restore()
  puts "info: database restored" if pg_restore()
end