Active Record streaming/Enumerable results

I have come to conclusion that Active Record cannot stream, or enumerate
over rows; this I base on the contract with Connection Adapters that
return arrays of hashes – all rows from the query (with regards to
and other similar options). In other words I didn’t find any way for
Connection Adapter to return an Enumerable (or similar) that fetches the
next row from the database on demand – in fact streaming the results of

I understand that there is support for batch in ActiveRecord::Batches
that is not the same as on demand streaming of results. Interesting work
this has been done for PostgreSQL in

Are there any plans for more general inclusion of cursors / streaming
results in Active Record? Can anyone suggest an alternative?



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs