Sha256: 4496079a306aa4e2dc8917c3e18bd62e59f161a4c3bdd7f4643fb661decb02ec

Contents?: true

Size: 1.29 KB

Versions: 42

Compression:

Stored size: 1.29 KB

Contents

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

# Command class must be in module Flydata::Command
module Flydata
  module Command
    class Mysqlbinlog < Sync
      include MysqlCommandBase

      def generate_command(dbconf, args)
        skip_ssl = !!args.delete('--skip-ssl')
        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
        if skip_ssl
          dbconf.delete('ssl_ca')
          dbconf.delete('ssl_cipher')
        end
        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

NOTE: Add --skip-ssl to skip ssl options
EOT
          return
        end
        FlydataCore::Mysql::CommandGenerator::generate_mysql_cmd(dbconf)
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
flydata-0.8.10.2 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.8.10.1 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.8.9.11 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.8.10 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.8.9 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.8.8 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.8.7 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.8.6 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.8.5 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.8.4 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.8.3 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.8.2 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.8.1 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.8.0 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.7.19 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.7.18 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.7.17 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.7.16 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.7.15 lib/flydata/source_mysql/command/mysqlbinlog.rb
flydata-0.7.14 lib/flydata/source_mysql/command/mysqlbinlog.rb