Rewrite with sinatra/ruby-mysql