module RedshiftConnector::Exporter

Public Class Methods

builder() click to toggle source
# File lib/redshift_connector/exporter.rb, line 13
def Exporter.builder
  default_data_source.exporter_builder
end
default_data_source() click to toggle source
# File lib/redshift_connector/exporter.rb, line 9
def Exporter.default_data_source
  @default_data_source or raise ArgumentError, "RedshiftConnector::Exporter.default_data_source was not set"
end
default_data_source=(ds) click to toggle source
# File lib/redshift_connector/exporter.rb, line 5
def Exporter.default_data_source=(ds)
  @default_data_source = ds
end
for_query(**params) click to toggle source
# File lib/redshift_connector/exporter.rb, line 25
def Exporter.for_query(**params)
  builder.build_for_query(**params)
end
for_table(**params) click to toggle source
# File lib/redshift_connector/exporter.rb, line 21
def Exporter.for_table(**params)
  builder.build_for_table(**params)
end
for_table_delta(**params) click to toggle source
# File lib/redshift_connector/exporter.rb, line 17
def Exporter.for_table_delta(**params)
  builder.build_for_table_delta(**params)
end
foreach(**params, &block) click to toggle source
# File lib/redshift_connector/exporter.rb, line 29
def Exporter.foreach(**params, &block)
  exporter = for_query(**params)
  bundle = exporter.execute
  r = DataFileBundleReader.new(bundle, logger: bundle.logger)
  begin
    r.each_row(&block)
  ensure
    bundle.clear if bundle.respond_to?(:clear)
  end
end