Class: RedshiftCopier::CopyFile
- Inherits:
-
Object
- Object
- RedshiftCopier::CopyFile
- Defined in:
- lib/redshift_copier/copy_file.rb
Instance Attribute Summary collapse
-
#aws_access_key_id ⇒ Object
readonly
Returns the value of attribute aws_access_key_id.
-
#aws_secret_access_key ⇒ Object
readonly
Returns the value of attribute aws_secret_access_key.
-
#copy_command_options ⇒ Object
readonly
Returns the value of attribute copy_command_options.
-
#create_sql ⇒ Object
readonly
Returns the value of attribute create_sql.
-
#db_config ⇒ Object
readonly
Returns the value of attribute db_config.
-
#s3_csv_location ⇒ Object
readonly
Returns the value of attribute s3_csv_location.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
-
#initialize(args) ⇒ CopyFile
constructor
A new instance of CopyFile.
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ CopyFile
Returns a new instance of CopyFile.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/redshift_copier/copy_file.rb', line 5 def initialize(args) @schema = args.fetch(:schema) @table = args.fetch(:table) @create_sql = args.fetch(:create_sql) @aws_access_key_id = args.fetch(:aws_access_key_id) @aws_secret_access_key = args.fetch(:aws_secret_access_key) @s3_csv_location = args.fetch(:s3_csv_location) @db_config = args.fetch(:db_config) = args.fetch(:copy_command_options, "dateformat 'auto' timeformat 'auto' blanksasnull emptyasnull escape removequotes delimiter ',' ignoreheader 1;") end |
Instance Attribute Details
#aws_access_key_id ⇒ Object (readonly)
Returns the value of attribute aws_access_key_id.
3 4 5 |
# File 'lib/redshift_copier/copy_file.rb', line 3 def aws_access_key_id @aws_access_key_id end |
#aws_secret_access_key ⇒ Object (readonly)
Returns the value of attribute aws_secret_access_key.
3 4 5 |
# File 'lib/redshift_copier/copy_file.rb', line 3 def aws_secret_access_key @aws_secret_access_key end |
#copy_command_options ⇒ Object (readonly)
Returns the value of attribute copy_command_options.
3 4 5 |
# File 'lib/redshift_copier/copy_file.rb', line 3 def end |
#create_sql ⇒ Object (readonly)
Returns the value of attribute create_sql.
3 4 5 |
# File 'lib/redshift_copier/copy_file.rb', line 3 def create_sql @create_sql end |
#db_config ⇒ Object (readonly)
Returns the value of attribute db_config.
3 4 5 |
# File 'lib/redshift_copier/copy_file.rb', line 3 def db_config @db_config end |
#s3_csv_location ⇒ Object (readonly)
Returns the value of attribute s3_csv_location.
3 4 5 |
# File 'lib/redshift_copier/copy_file.rb', line 3 def s3_csv_location @s3_csv_location end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
3 4 5 |
# File 'lib/redshift_copier/copy_file.rb', line 3 def schema @schema end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
3 4 5 |
# File 'lib/redshift_copier/copy_file.rb', line 3 def table @table end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 |
# File 'lib/redshift_copier/copy_file.rb', line 16 def run drop create copy end |