Class | Sip::MySQLSipper |
In: |
lib/sip/databases/mysql.rb
|
Parent: | DBBase |
# File lib/sip/databases/mysql.rb, line 5 def initialize(args, sipper) super(args, sipper) @connection = Mysql::new @args['host'], @args['username'], @args['password'], @args['dbname'], @args['port'] end
# File lib/sip/databases/mysql.rb, line 10 def cmd_line_execute_string(select) opts = CmdOpts.new opts.set 'N', 'B', 'C', 'q' opts['u'] = @args['username'] opts['password'] = @args['password'] opts['h'] = @args['host'] opts['e'] = "'#{select}'" opts['P'] = @args['port'] path = `which mysql` opts.to_s(path.strip, @args['dbname']) end
# File lib/sip/databases/mysql.rb, line 31 def convert_to_hive_type(typename) case typename.split("(").first when "tinyint" then "TINYINT" when "smallint" then "MEDIUMINT" when "mediumint" then "INT" when "int" then "INT" when "bigint" then "BIGINT" when "decimal" then "FLOAT" when "numeric" then "DOUBLE" when "float" then "FLOAT" when "real" then "DOUBLE" when "double" then "DOUBLE" when "boolean" then "BOOLEAN" else "STRING" end end