class DumpTruck::LoggableTruck

Public Class Methods

new(schema_config, client, translator, logger) click to toggle source
Calls superclass method
# File lib/dump_truck/loggable_truck.rb, line 3
def initialize(schema_config, client, translator, logger)
  super(schema_config, client, translator)
  @logger = logger
  @processed_rows = 0
end

Protected Instance Methods

dump_data(config, table, target) click to toggle source
Calls superclass method
# File lib/dump_truck/loggable_truck.rb, line 28
def dump_data(config, table, target)
  @logger.info("=> Dumping #{table.green} in #{schema_config.name.blue}")
  super
  @logger.info("=> Dumped #{@processed_rows.to_s.green} rows from #{table.green} in #{schema_config.name.blue}")
  @processed_rows = 0
end
dump_schema(tables) click to toggle source
Calls superclass method
# File lib/dump_truck/loggable_truck.rb, line 22
def dump_schema(tables)
  @logger.info("Dumping data from #{schema_config.name.blue}")
  super
  @logger.info("Dumped data from #{schema_config.name.blue}")
end
extract_insert(line) click to toggle source
Calls superclass method
# File lib/dump_truck/loggable_truck.rb, line 35
def extract_insert(line)
  fields, data = super
  @processed_rows += data.size
  [fields, data]
end
extract_table(line) click to toggle source
Calls superclass method
# File lib/dump_truck/loggable_truck.rb, line 16
def extract_table(line)
  table = super
  @logger.info("=> #{table.green} in #{schema_config.name.blue}")
  table
end
extract_tables() click to toggle source
Calls superclass method
# File lib/dump_truck/loggable_truck.rb, line 11
def extract_tables
  @logger.info("Getting tables from #{schema_config.name.blue}")
  super
end