Sha256: 79ab3816fed0cbdfb5c1ab8c4d53f066344cffcb40d50afd98304799514dae4f
Contents?: true
Size: 1.07 KB
Versions: 45
Compression:
Stored size: 1.07 KB
Contents
require 'open3' require 'flydata-core/mysql/command_generator' # Command class must be in module Flydata::Command module Flydata module Command module MysqlCommandBase 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 def generate_command(dbconf, args) dbconf.delete('tables') dbconf[:custom_option_end] = args.join(' ') FlydataCore::Mysql::CommandGenerator::generate_mysql_cmd(dbconf) end def flush; end def reset; end def skip; end def generate_table_ddl; end end end end
Version data entries
45 entries across 45 versions & 1 rubygems