title: Rails ActiveRecord raw sql read data without loading everything into memory (without pagination)
body: <p>.NET has SqlDataReader:</p>
  
  <pre><code>using(SqlDataReader rdr = cmd.ExecuteReader())
  {
      while (rdr.Read())
      {
          var myString = rdr.GetString(0);
          // ...
      }
  }
  </code></pre>
  
  <p>I need to use raw sql with Rails and ActiveRecord (existing project, can't add any gems).</p>
  
  <p>What I can do now is just this:</p>
  
  <pre><code>ActiveRecord::Base.connection.exec_query(query)
  </code></pre>
  
  <p>Which works, but for my <code>select ...</code> loads all the rows into memory. I would really like to iterate through results without loading it into memory like I can do it in .NET</p>
  
  <p>Is it possible with Ruby/Rails/ActiveRecord?</p>
  
  <p>I'm aware of pagination, just wonder if there is another way?</p>