primary_key_names[RW]
Cached array of primary key names
Shared functionality for DirectTableScan and ProxiedTableScan
Creates a new DirectTableScan instance
* session: a Session object representing the current database session * left_table: name of the table in the left database * right_table: name of the table in the right database. If not given, same like left_table
# File lib/rubyrep/table_scan.rb, line 44 def initialize(session, left_table, right_table = nil) if session.left.primary_key_names(left_table).empty? raise "Table '#{left_table}' doesn't have a primary key. Cannot scan." end self.session, self.left_table, self.right_table = session, left_table, right_table self.right_table ||= self.left_table self.primary_key_names = session.left.primary_key_names left_table end
Returns a hash of scan options for this table scan.
# File lib/rubyrep/table_scan.rb, line 23 def scan_options @scan_options ||= session.configuration.options_for_table(left_table) end
Inform new progress to progress printer steps is the number of processed records.
# File lib/rubyrep/table_scan.rb, line 29 def update_progress(steps) return unless progress_printer unless @progress_printer_instance total_records = session.left.select_one("select count(*) as n from #{session.left.quote_table_name(left_table)}")['n'].to_i + session.right.select_one("select count(*) as n from #{session.right.quote_table_name(right_table)}")['n'].to_i @progress_printer_instance = progress_printer.new(total_records, session, left_table, right_table) end @progress_printer_instance.step(steps) end
Generated with the Darkfish Rdoc Generator 2.