I am calling a stored procedure that returns several results.
In Rails 4, the only solution found is to initiate a new Mysql2::Client
with the flag MULTI_STATEMENTS. It seems not right to me to open a new connection to the database server.
options = Rails.application.config_for(:database).merge flags: Mysql2::Client::MULTI_STATEMENTS
client = Mysql2::Client.new options
results = client.query %Q{CALL my_proc('#{params}')}
client.close
results
So my question: is there a better solution as of now?