Replies: 1 comment 12 replies
-
It looks like this could be implemented using an option to |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In our Rails app I would like to sometimes use Sequel instead of Active Record for running data migrations. The one feature I'm missing in Sequel is Active Record's
#in_batches
, which returns datasets representing a batch of records, which makes it easier to perform bulk operations without actually loading records into memory.One classic example is backfilling a newly added column:
From what I could tell, the closest Sequel offers is
#paged_each
, which is the equivalent of#find_each
. It could technically be used to implement the above:Since this isn't that efficient, Active Record 7.1 will optimize this using an approach that seems similar to Sequel's
:filter
strategy for#paged_each
. Would you be open to a PR adding support for batch processing like the one Active Record 7.1 will have?Beta Was this translation helpful? Give feedback.
All reactions