Method: Arrival::CliGenerator#generate

Defined in:
lib/arrival/cli_generator.rb

#generate(_table_name = nil, statement) ⇒ String

Generates the percona command. Fills all the connection credentials from the current AR connection, but that can be amended via ENV-vars: PERCONA_DB_HOST, PERCONA_DB_USER, PERCONA_DB_PASSWORD, PERCONA_DB_NAME Table name can’t not be amended, it populates automatically from the migration data

deprecated: @param table_name [String]

Parameters:

  • statement (String)

    MySQL statement

Returns:

  • (String)


51
52
53
54
55
# File 'lib/arrival/cli_generator.rb', line 51

def generate(_table_name=nil, statement)
  alter_argument = AlterArgument.new(statement)

  "#{command} #{all_options} #{alter_argument} #{Option.new("table", alter_argument.table_name)}"
end