Class: Backhoe::Mysql
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Instance Method Details
#dump(skip_tables: []) ⇒ Object
39 40 41 42 43 |
# File 'lib/backhoe.rb', line 39 def dump skip_tables: [] mysqldump = `which mysqldump`.strip raise RuntimeError, "Cannot find mysqldump." if mysqldump.blank? sh "#{mysqldump} --no-create-db --single-transaction --quick -e #{(skip_tables)} #{} > #{file_path}" end |
#load ⇒ Object
45 46 47 48 49 |
# File 'lib/backhoe.rb', line 45 def load mysql = `which mysql`.strip raise RuntimeError, "Cannot find mysql." if mysql.blank? sh "#{mysql} #{} < #{file_path}" end |