def dump_single(field, generator, elem)
      array = generator.send(field)
      index = array.find_index(elem)
      fail ArgumentError, "#{elem.inspect} not part of #{array.inspect}" if !index

      lines = generator.send(:"dump_#{field}").lines.map(&:strip)
      lines[index]
    end
def dump_single(field, generator, elem)
      array = generator.send(field)
      index = array.find_index(elem)
      fail ArgumentError, "#{elem.inspect} not part of #{array.inspect}" if !index

      lines = generator.send(:"dump_#{field}").lines.map(&:strip)
      lines[index]
    end
Creates a SchemaError for the given table with an array of schema
 differences. Each element of schema_diffs should be a hash of the
 following form:

 :field => if a column is different, use FIELD_COLUMNS;
           if an index is different, use FIELD_INDEXES
 :type => if there's an extra column/index, use TYPE_EXTRA;
          if there's a missing column/index, use TYPE_MISSING;
          if there's a mismatched column/index, use TYPE_MISMATCH

 For TYPE_EXTRA and TYPE_MISSING:
 :generator => the table generator that contains the extra/missing index/column
 :elem => the missing index/column, as a hash from the table generator

 For TYPE_MISMATCH:
 :db_generator => the db table generator
 :exp_generator => the expected table generator
 :db_elem => the index/column in the db table generator as a hash
 :exp_elem => the index/column in the exp table generator as a hash
 Dumps a single column/index from the generator to its string representation.

 field: FIELD_COLUMNS for a column or FIELD_INDEXES for an index
 generator: the table generator
 elem: the index/column in the generator as a hash