Class: PerconaAr::PtOnlineSchemaChangeExecutor
- Inherits:
-
Object
- Object
- PerconaAr::PtOnlineSchemaChangeExecutor
- Includes:
- FileUtils
- Defined in:
- lib/percona_ar/pt_online_schema_change_executor.rb
Instance Attribute Summary collapse
-
#conn ⇒ Object
Returns the value of attribute conn.
-
#sql ⇒ Object
Returns the value of attribute sql.
-
#table ⇒ Object
Returns the value of attribute table.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(table, sql, conn = ActiveRecord::Base.connection) ⇒ PtOnlineSchemaChangeExecutor
constructor
A new instance of PtOnlineSchemaChangeExecutor.
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
#conn ⇒ Object
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 |
#sql ⇒ Object
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 |
#table ⇒ Object
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
#call ⇒ Object
15 16 17 |
# File 'lib/percona_ar/pt_online_schema_change_executor.rb', line 15 def call sh %Q(#{boilerplate}#{suffix(table, sql)}) end |