Class: Snapshooter::Datastore::Mysql
- Inherits:
-
Object
- Object
- Snapshooter::Datastore::Mysql
- Defined in:
- lib/snapshooter/datastore/mysql.rb
Instance Method Summary collapse
- #filename ⇒ Object
-
#initialize(options = {}) ⇒ Mysql
constructor
A new instance of Mysql.
- #restore(file) ⇒ Object
- #snapshot(tmp_file) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Mysql
Returns a new instance of Mysql.
6 7 8 |
# File 'lib/snapshooter/datastore/mysql.rb', line 6 def initialize(={}) @options = end |
Instance Method Details
#filename ⇒ Object
18 19 20 |
# File 'lib/snapshooter/datastore/mysql.rb', line 18 def filename "#{id}.sql" end |
#restore(file) ⇒ Object
14 15 16 |
# File 'lib/snapshooter/datastore/mysql.rb', line 14 def restore(file) `mysql #{} #{@options[:database]} < #{file}` end |
#snapshot(tmp_file) ⇒ Object
10 11 12 |
# File 'lib/snapshooter/datastore/mysql.rb', line 10 def snapshot(tmp_file) `mysqldump #{} #{@options[:database]} > #{tmp_file}` end |