Class: Dbmanager::Adapters::Mysql::Dumper
- Inherits:
-
Object
- Object
- Dbmanager::Adapters::Mysql::Dumper
- Includes:
- Connectable
- Defined in:
- lib/dbmanager/adapters/mysql.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #dump_command ⇒ Object
- #ignoretables ⇒ Object
-
#initialize(source, filename) ⇒ Dumper
constructor
A new instance of Dumper.
- #mysqldump_version ⇒ Object
- #run ⇒ Object
Methods included from Connectable
Constructor Details
#initialize(source, filename) ⇒ Dumper
Returns a new instance of Dumper.
21 22 23 24 |
# File 'lib/dbmanager/adapters/mysql.rb', line 21 def initialize(source, filename) @source = source @filename = filename end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
19 20 21 |
# File 'lib/dbmanager/adapters/mysql.rb', line 19 def filename @filename end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
19 20 21 |
# File 'lib/dbmanager/adapters/mysql.rb', line 19 def source @source end |
Instance Method Details
#dump_command ⇒ Object
35 36 37 |
# File 'lib/dbmanager/adapters/mysql.rb', line 35 def dump_command "mysqldump #{ignoretables} #{set_gtid_purged_off} #{params(source)} > '#{filename}'" end |
#ignoretables ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/dbmanager/adapters/mysql.rb', line 39 def ignoretables if source.ignoretables.present? source.ignoretables.inject [] do |arr, table| arr << "--ignore-table=#{source.database}.#{table}" end.join ' ' end end |