Module: Flydata::Command::MysqlCommandBase

Included in:
Mysql, Mysqlbinlog, Mysqldump
Defined in:
lib/flydata/command/mysql_command_base.rb

Instance Method Summary collapse

Instance Method Details

#fix_binlogposObject



40
# File 'lib/flydata/command/mysql_command_base.rb', line 40

def fix_binlogpos; end

#flushObject



36
# File 'lib/flydata/command/mysql_command_base.rb', line 36

def flush; end

#generate_command(dbconf, args) ⇒ Object



30
31
32
33
34
# File 'lib/flydata/command/mysql_command_base.rb', line 30

def generate_command(dbconf, args)
  dbconf.delete('tables')
  dbconf[:custom_option_end] = args.join(' ')
  FlydataCore::Mysql::CommandGenerator::generate_mysql_cmd(dbconf)
end

#generate_table_ddlObject



39
# File 'lib/flydata/command/mysql_command_base.rb', line 39

def generate_table_ddl; end

#resetObject



37
# File 'lib/flydata/command/mysql_command_base.rb', line 37

def reset; end

#run(*args) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/flydata/command/mysql_command_base.rb', line 8

def run(*args)
  de = retrieve_sync_data_entry
  cmd = generate_command(de['mysql_data_entry_preference'], args)
  return if cmd.to_s.empty?
  $stderr.puts "command:#{cmd}" if FLYDATA_DEBUG
  if $stdin.tty?
    # interactive shell
    system cmd
  else
    # execute queries given to $stdin
    Open3.popen2e(cmd) do |i, o, wt|
      $stdin.each_line do |line|
        i.print line
      end
      i.close
      while line = o.gets
        print line
      end
    end
  end
end

#skipObject



38
# File 'lib/flydata/command/mysql_command_base.rb', line 38

def skip; end