Class: Backhoe::Dump
- Inherits:
-
Struct
- Object
- Struct
- Backhoe::Dump
- Includes:
- Rake::DSL
- Defined in:
- lib/backhoe/dump.rb
Defined Under Namespace
Classes: SanitizedDatabase
Instance Attribute Summary collapse
-
#database ⇒ Object
Returns the value of attribute database.
-
#path ⇒ Object
Returns the value of attribute path.
-
#skip_columns ⇒ Object
Returns the value of attribute skip_columns.
-
#skip_tables ⇒ Object
Returns the value of attribute skip_tables.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(*args) ⇒ Dump
constructor
A new instance of Dump.
Constructor Details
#initialize(*args) ⇒ Dump
Returns a new instance of Dump.
7 8 9 10 11 |
# File 'lib/backhoe/dump.rb', line 7 def initialize *args super self.skip_tables ||= [] self.skip_columns ||= {} end |
Instance Attribute Details
#database ⇒ Object
Returns the value of attribute database
4 5 6 |
# File 'lib/backhoe/dump.rb', line 4 def database @database end |
#path ⇒ Object
Returns the value of attribute path
4 5 6 |
# File 'lib/backhoe/dump.rb', line 4 def path @path end |
#skip_columns ⇒ Object
Returns the value of attribute skip_columns
4 5 6 |
# File 'lib/backhoe/dump.rb', line 4 def skip_columns @skip_columns end |
#skip_tables ⇒ Object
Returns the value of attribute skip_tables
4 5 6 |
# File 'lib/backhoe/dump.rb', line 4 def skip_tables @skip_tables end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/backhoe/dump.rb', line 13 def call if skip_tables.any? raise NotImplementedError if database.postgresql? end if skip_columns.any? raise NotImplementedError if database.postgresql? SanitizedDatabase.new(skip_columns, path).dump do |tables| self.skip_tables += tables dump end else dump end end |