Sha256: 6781bac838b98620abe7acd91a42a3b7a58fb656bf3b99bfaac762347d6e645d

Contents?: true

Size: 1.1 KB

Versions: 10

Compression:

Stored size: 1.1 KB

Contents

require 'flydata/command/sync'
require 'flydata/command/mysql_command_base'

module Flydata
  module Command
    class Mysqlbinlog < Sync
      include MysqlCommandBase

      def generate_command(dbconf, args)
        dbconf.delete('tables')
        dbconf[:custom_option_end] = args.join(' ')
        dbconf[:command] = 'mysqlbinlog'
        # --default-character-set=utf8 is not supported
        dbconf[:no_default_option] = true
        # ssl is not supported for mysql5.6 or older mysqlbinlog command
        dbconf.delete('ssl_ca')
        dbconf.delete('ssl_cipher')
        dbconf.delete('database')
        if args.empty?
          puts <<EOT
example:
1. Dump raw binlog
  flydata mysqlbinlog --raw --read-from-remote-server --result-file "binlog-" mysql-bin-changelog.xxxx
2. Dump decoded binlog data
  flydata mysqlbinlog  -vv --base64-output=decode-row --hexdump --read-from-remote-server --start-position=4 --stop-position=yyyyy mysql-bin-changelog.xxxxx > mysql-bin-changelog.xxxxx
EOT
          return
        end
        FlydataCore::Mysql::CommandGenerator::generate_mysql_cmd(dbconf)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
flydata-0.6.3 lib/flydata/command/mysqlbinlog.rb
flydata-0.6.2 lib/flydata/command/mysqlbinlog.rb
flydata-0.6.1 lib/flydata/command/mysqlbinlog.rb
flydata-0.6.0 lib/flydata/command/mysqlbinlog.rb
flydata-0.5.21 lib/flydata/command/mysqlbinlog.rb
flydata-0.5.20 lib/flydata/command/mysqlbinlog.rb
flydata-0.5.17 lib/flydata/command/mysqlbinlog.rb
flydata-0.5.16 lib/flydata/command/mysqlbinlog.rb
flydata-0.5.15 lib/flydata/command/mysqlbinlog.rb
flydata-0.5.14 lib/flydata/command/mysqlbinlog.rb