Sha256: 76b348eed54987ac4a867c293641bea62380374923c2b855dd27b6c79b24de08

Contents?: true

Size: 890 Bytes

Versions: 96

Compression:

Stored size: 890 Bytes

Contents

class Dynomite::Migration
  class Executor
    include Dynomite::DbConfig

    # Examples:
    #  Executor.new(:create_table, params) or
    #  Executor.new(:update_table, params)
    #
    # The params are generated frmo the dsl.params
    attr_accessor :table_name
    def initialize(table_name, method_name, params)
      @table_name = table_name
      @method_name = method_name # create_table or update_table
      @params = params
    end

    def run
      begin
        # Examples:
        #   result = db.create_table(@params)
        #   result = db.update_table(@params)
        result = db.send(@method_name, @params)

        puts "DynamoDB Table: #{@table_name} Status: #{result.table_description.table_status}"
      rescue Aws::DynamoDB::Errors::ServiceError => error
        puts "Unable to #{@method_name.to_s.gsub('_',' ')}: #{error.message}"
      end
    end
  end
end

Version data entries

96 entries across 96 versions & 2 rubygems

Version Path
jets-1.0.7 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-1.0.6 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-1.0.5 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-1.0.4 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-1.0.3 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-1.0.2 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-1.0.1 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-1.0.0 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-0.10.4 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-0.10.3 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-0.10.2 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-0.10.1 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-0.10.0 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-0.9.2 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-0.9.1 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-0.9.0 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-0.8.18 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-0.8.17 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-0.8.15 vendor/dynomite/lib/dynomite/migration/executor.rb
jets-0.8.14 vendor/dynomite/lib/dynomite/migration/executor.rb