Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch for ActiveRecord #85

Open
g8d3 opened this issue Oct 6, 2016 · 3 comments
Open

Batch for ActiveRecord #85

g8d3 opened this issue Oct 6, 2016 · 3 comments

Comments

@g8d3
Copy link

g8d3 commented Oct 6, 2016

Would it be possible to add a batch method for ActiveRecord:

Model.upsert do |u|
  # N times
  u.row attr1: val1
end

And detect created_at and updated_at, so you do not have to write:

now = Time.now
u.row attr1: val1, created_at: now, updated_at: now
@abaldwin88
Copy link

Looks like this is already open in #33 ?

@pnomolos
Copy link
Collaborator

The second portion is, the first is a new feature request.

@nitvik
Copy link

nitvik commented Apr 24, 2017

This feature should be implemented, it will make the batch upsert slow. The whole point of batch upsert is speed. If it has to work like ActiveRecord, then why just active record, there are many other gems like HistoryTracker and all which override ActiveRecord, it should work with them too then? See the whole point of batch insert is to use a ruby driver and make a direct query. Just my suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants