Class: Droonga::Plugins::Groonga::ColumnRename::Command

Inherits:
GenericCommand
  • Object
show all
Defined in:
lib/droonga/plugins/groonga/column_rename.rb

Instance Method Summary collapse

Methods inherited from GenericCommand

#execute, #initialize

Constructor Details

This class inherits a constructor from Droonga::Plugins::Groonga::GenericCommand

Instance Method Details

#process_request(request) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/droonga/plugins/groonga/column_rename.rb', line 26

def process_request(request)
  command_class = ::Groonga::Command.find("column_rename")
  @command = command_class.new("column_rename", request)

  table_name = valid_table_name("table", :error_result => false)
  column_name = valid_column_name("name", :table_name => table_name,
                                          :error_result => false)

  new_name = @command["new_name"]

  rename_column(table_name, column_name, new_name)
end