Module: MysqlSpammer

Defined in:
bin/mysql_warmer

Instance Method Summary collapse

Instance Method Details

#initialize(options) ⇒ Object



48
49
50
51
# File 'bin/mysql_warmer', line 48

def initialize(options)
  @options = options
  @query = ""
end

#receive_data(data) ⇒ Object



53
54
55
# File 'bin/mysql_warmer', line 53

def receive_data(data)
  @query << data
end

#unbindObject



57
58
59
60
61
62
# File 'bin/mysql_warmer', line 57

def unbind
  return if @query.empty? or @query !~ /^select/i 

  puts @query.inspect if @options[:verbose]
  SQL.raw(@query) {}
end