Class: Dbcp::MysqlDatabase

Inherits:
Database show all
Defined in:
lib/dbcp/databases/mysql_database.rb

Instance Method Summary collapse

Methods inherited from Database

build, klass_for_adapter

Instance Method Details

#export_command(snapshot_file) ⇒ Object



3
4
5
# File 'lib/dbcp/databases/mysql_database.rb', line 3

def export_command(snapshot_file)
  %W[mysqldump #{build_socket_or_host} #{build_port} --user=#{username} --password=#{password} --add-drop-table --extended-insert --result-file=#{snapshot_file.path} #{database}].reject(&:empty?).shelljoin
end

#import_command(snapshot_file) ⇒ Object



7
8
9
# File 'lib/dbcp/databases/mysql_database.rb', line 7

def import_command(snapshot_file)
  %W[mysql #{build_socket_or_host} #{build_port} --user=#{username} --password=#{password} #{database}].reject(&:empty?).shelljoin + ' < ' + snapshot_file.path.shellescape
end