.NET has SqlDataReader:

```
using(SqlDataReader rdr = cmd.ExecuteReader())
{
    while (rdr.Read())
    {
        var myString = rdr.GetString(0);
        // ...
    }
}

```

I need to use raw sql with Rails and ActiveRecord (existing project, can't add any gems).

What I can do now is just this:

```
ActiveRecord::Base.connection.exec_query(query)

```

Which works, but for my `select ...` 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

Is it possible with Ruby/Rails/ActiveRecord?

I'm aware of pagination, just wonder if there is another way?