Class: RedshiftCopier::Copy
- Inherits:
-
Object
- Object
- RedshiftCopier::Copy
- Defined in:
- lib/redshift_copier/copy.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_path ⇒ Object
readonly
Returns the value of attribute s3_path.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
-
#initialize(args) ⇒ Copy
constructor
A new instance of Copy.
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ Copy
Returns a new instance of Copy.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/redshift_copier/copy.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_path = args.fetch(:s3_path) @db_config = args.fetch(:db_config) @copy_command_options = 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.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.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.rb', line 3 def @copy_command_options end |
#create_sql ⇒ Object (readonly)
Returns the value of attribute create_sql.
3 4 5 |
# File 'lib/redshift_copier/copy.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.rb', line 3 def db_config @db_config end |
#s3_path ⇒ Object (readonly)
Returns the value of attribute s3_path.
3 4 5 |
# File 'lib/redshift_copier/copy.rb', line 3 def s3_path @s3_path end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
3 4 5 |
# File 'lib/redshift_copier/copy.rb', line 3 def schema @schema end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
3 4 5 |
# File 'lib/redshift_copier/copy.rb', line 3 def table @table end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 |
# File 'lib/redshift_copier/copy.rb', line 16 def run drop create copy end |