2008-08-27 12:09:39 +00:00
|
|
|
require 'mysql'
|
|
|
|
|
|
|
|
class Mysql
|
2008-09-08 00:48:47 +00:00
|
|
|
|
2008-09-06 16:17:06 +00:00
|
|
|
def async_query(sql, timeout = nil)
|
2008-08-27 12:09:39 +00:00
|
|
|
send_query(sql)
|
2008-08-27 23:11:58 +00:00
|
|
|
select [ (@sockets ||= {})[socket] ||= IO.new(socket) ], nil, nil, nil
|
2008-08-27 12:09:39 +00:00
|
|
|
get_result
|
|
|
|
end
|
2008-09-06 16:17:06 +00:00
|
|
|
|
2008-08-27 12:09:39 +00:00
|
|
|
end
|
2008-09-06 01:59:20 +00:00
|
|
|
|
|
|
|
class Mysql::Result
|
|
|
|
def all_hashes
|
|
|
|
rows = []
|
|
|
|
each_hash { |row| rows << row }
|
|
|
|
rows
|
|
|
|
end
|
|
|
|
end
|