Class: PerconaAr::PtOnlineSchemaChangeExecutor

Inherits:
Object
  • Object
show all
Includes:
FileUtils
Defined in:
lib/percona_ar/pt_online_schema_change_executor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table, sql, conn = ActiveRecord::Base.connection) ⇒ PtOnlineSchemaChangeExecutor

Returns a new instance of PtOnlineSchemaChangeExecutor.



9
10
11
12
13
# File 'lib/percona_ar/pt_online_schema_change_executor.rb', line 9

def initialize(table, sql, conn = ActiveRecord::Base.connection)
  @table = table
  @sql = sql
  @conn = conn
end

Instance Attribute Details

#connObject

Returns the value of attribute conn.



7
8
9
# File 'lib/percona_ar/pt_online_schema_change_executor.rb', line 7

def conn
  @conn
end

#sqlObject

Returns the value of attribute sql.



7
8
9
# File 'lib/percona_ar/pt_online_schema_change_executor.rb', line 7

def sql
  @sql
end

#tableObject

Returns the value of attribute table.



7
8
9
# File 'lib/percona_ar/pt_online_schema_change_executor.rb', line 7

def table
  @table
end

Instance Method Details

#callObject



15
16
17
# File 'lib/percona_ar/pt_online_schema_change_executor.rb', line 15

def call
  sh %Q(#{boilerplate}#{suffix(table, sql)})
end