Sha256: c39b2cdbfdbbe0cd689c25ff287c222d26ff53a607962eb5fa63199338e0fcf5

Contents?: true

Size: 663 Bytes

Versions: 5

Compression:

Stored size: 663 Bytes

Contents

require 'flydata/parser_provider'
require_relative 'ddl_query_handler'

module Mysql
  class AlterTableQueryHandler < DdlQueryHandler
    PATTERN = /^ALTER TABLE/i

    def initialize(context)
      super
    end

    def pattern
      PATTERN
    end

    def process(record, normalized_query)
      emit_record(:alter_table, record, increment_table_rev: true) do
        result = ParserProvider.parser(:mysql, :mysql_alter_table).new.parse(record['query'])
        if result.nil?
          $log.warn("Recieved not supported alter table query. query:'#{record['query']}'")
          nil
        else
          result.tree
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
flydata-0.2.2 lib/flydata/fluent-plugins/mysql/alter_table_query_handler.rb
flydata-0.2.1 lib/flydata/fluent-plugins/mysql/alter_table_query_handler.rb
flydata-0.2.0 lib/flydata/fluent-plugins/mysql/alter_table_query_handler.rb
flydata-0.1.15 lib/flydata/fluent-plugins/mysql/alter_table_query_handler.rb
flydata-0.1.13 lib/flydata/fluent-plugins/mysql/alter_table_query_handler.rb