Class | RR::DirectTableScan |
In: |
lib/rubyrep/direct_table_scan.rb
|
Parent: | TableScan |
Scans two tables for differences. Doesn‘t have any reporting functionality by itself. Instead DirectTableScan#run yields all the differences for the caller to do with as it pleases. Usage:
1. Create a new DirectTableScan object and hand it all necessary information 2. Call DirectTableScan#run to do the actual comparison 3. The block handed to DirectTableScan#run receives all differences
left_caster | [RW] | The TypeCastingCursor for the left table |
right_caster | [RW] | The TypeCastingCursor for the right table |
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
Runs the table scan. Calls the block for every found difference. Differences are yielded with 2 parameters
* type: describes the difference, either :left (row only in left table), :right (row only in right table) or :conflict * row: For :left or :right cases a hash describing the row; for :conflict an array of left and right row. A row is a hash of column_name => value pairs.