Sha256: b3c8c75e6d31219e01cfab7328e057245cb87000b87419539e1d2f7b0d84f6c2
Contents?: true
Size: 589 Bytes
Versions: 13
Compression:
Stored size: 589 Bytes
Contents
# frozen_string_literal: true module TableSaw module Formats class Copy < TableSaw::Formats::Base def header "COPY #{table_name} (#{quoted_columns}) FROM STDIN;" end def footer ['\.', "\n"] end def dump_row(row) row end private def quoted_columns TableSaw.schema_cache.columns_hash(table_name) .each_key .map { |name| connection.quote_column_name(name) } .join(', ') end def connection TableSaw.schema_cache.connection end end end end
Version data entries
13 entries across 13 versions & 1 rubygems