Method: RedshiftConnector::UnloadQuery#to_sql

Defined in:
lib/redshift_connector/query.rb

#to_sqlObject



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/redshift_connector/query.rb', line 65

def to_sql
  <<-EndSQL.gsub(/^\s+/, '')
    unload ('#{escape_query(@query.to_sql)}')
    to '#{@bundle.url}'
    credentials '#{@bundle.credential_string}'
    gzip
    allowoverwrite
    parallel #{@enable_sort ? 'off' : 'on'}
    delimiter ',' escape addquotes
  EndSQL
end