Module: Flydata::Command::MysqlCommandBase

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

Instance Method Summary collapse

Instance Method Details

#flushObject


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

def flush; end

#generate_command(dbconf, args) ⇒ Object


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

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


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

def generate_table_ddl; end

#resetObject


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

def reset; end

#run(*args) ⇒ Object


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

def run(*args)
  de = 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


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

def skip; end