Class: Flydata::SourceMysql::PluginSupport::TruncateTableQueryHandler

Inherits:
TableDdlQueryHandler show all
Defined in:
lib/flydata/source_mysql/plugin_support/truncate_table_query_handler.rb

Constant Summary collapse

PATTERN =
/^TRUNCATE/i

Constants inherited from DdlQueryHandler

DdlQueryHandler::DDL_TABLE_QUERY

Constants included from PluginSupport::SyncRecordEmittable

PluginSupport::SyncRecordEmittable::RESPECT_ORDER, PluginSupport::SyncRecordEmittable::SEQ, PluginSupport::SyncRecordEmittable::SRC_POS, PluginSupport::SyncRecordEmittable::TABLE_NAME, PluginSupport::SyncRecordEmittable::TABLE_REV, PluginSupport::SyncRecordEmittable::TYPE, PluginSupport::SyncRecordEmittable::V

Instance Attribute Summary

Attributes included from PluginSupport::SyncRecordEmittable

#context

Instance Method Summary collapse

Methods inherited from DdlQueryHandler

#acceptable_db?, #emit_record, #table_info

Methods included from PluginSupport::SyncRecordEmittable

#emit_sync_records

Constructor Details

#initialize(context) ⇒ TruncateTableQueryHandler

Returns a new instance of TruncateTableQueryHandler.



10
11
12
# File 'lib/flydata/source_mysql/plugin_support/truncate_table_query_handler.rb', line 10

def initialize(context)
  super
end

Instance Method Details

#patternObject



14
15
16
# File 'lib/flydata/source_mysql/plugin_support/truncate_table_query_handler.rb', line 14

def pattern
  PATTERN
end

#process(record) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/flydata/source_mysql/plugin_support/truncate_table_query_handler.rb', line 18

def process(record)
  emit_record(:truncate_table, record) do |opt|
    {
      table_name: record['table_name'],
      query: record["query"]
    }
  end
end